X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qc;h=2ba82251de5c95823ecdd66fca2073f3ac704e53;hb=6c3104a65005223002dfb708d4dec7481722c355;hp=b2da5df1a53b3ff1ae4d755fe10de177a4719e7a;hpb=d15f34b027d08e43713c98d2a27756df27164c34;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index b2da5df1a..2ba82251d 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -47,8 +47,6 @@ float checkrules_firstblood; float yoda; float damage_goodhits; float damage_gooddamage; -float headshot; -float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after use .float dmg_team; .float teamkill_complain; @@ -86,15 +84,6 @@ float IsFlying(entity a) return 1; } -vector GetHeadshotMins(entity targ) -{ - return '-0.5 0 0' * PL_HEAD_x + '0 -0.5 0' * PL_HEAD_y + '0 0 1' * (targ.maxs_z - PL_HEAD_z); -} -vector GetHeadshotMaxs(entity targ) -{ - return '0.5 0 0' * PL_HEAD_x + '0 0.5 0' * PL_HEAD_y + '0 0 1' * targ.maxs_z; -} - void UpdateFrags(entity player, float f) { PlayerTeamScore_AddScore(player, f); @@ -306,13 +295,13 @@ void LogDeath(string mode, float deathtype, entity killer, entity killed) void Send_KillNotification (string s1, string s2, string s3, float msg, float type) { - WriteByte(MSG_ALL, SVC_TEMPENTITY); - WriteByte(MSG_ALL, TE_CSQC_KILLNOTIFY); - WriteString(MSG_ALL, s1); - WriteString(MSG_ALL, s2); - WriteString(MSG_ALL, s3); - WriteShort(MSG_ALL, msg); - WriteByte(MSG_ALL, type); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_CSQC_KILLNOTIFY); + WriteString(MSG_BROADCAST, s1); + WriteString(MSG_BROADCAST, s2); + WriteString(MSG_BROADCAST, s3); + WriteShort(MSG_BROADCAST, msg); + WriteByte(MSG_BROADCAST, type); } // Function is used to send a generic centerprint whose content CSQC gets to decide (gentle version or not in the below cases) @@ -335,7 +324,7 @@ void Send_CSQC_KillCenterprint(entity e, string s1, string s2, float msg, float void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) { string s, a, msg; - float w, type; + float type; if (targ.classname == "player") { @@ -369,7 +358,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) deathtype = KILL_TEAM_BLUE; } - Send_KillNotification(s, msg, ftos(w), deathtype, MSG_SUICIDE); + Send_KillNotification(s, msg, "", deathtype, MSG_SUICIDE); } else if (attacker.classname == "player") { @@ -788,31 +777,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if(targ.takedamage == DAMAGE_AIM) if(targ != attacker) { - if(damage_headshotbonus) - { - if(targ.classname == "player") - { - // HEAD SHOT: - // find height of hit on player axis - // if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot - vector headmins, headmaxs, org; - org = antilag_takebackorigin(targ, time - ANTILAG_LATENCY(attacker)); - headmins = org + GetHeadshotMins(targ); - headmaxs = org + GetHeadshotMaxs(targ); - if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs)) - { - deathtype |= HITTYPE_HEADSHOT; - } - } - else if(targ.classname == "turret_head") - { - deathtype |= HITTYPE_HEADSHOT; - } - if(deathtype & HITTYPE_HEADSHOT) - if(damage_headshotbonus > 0) - damage *= 1 + damage_headshotbonus; - } - entity victim; if((targ.vehicle_flags & VHF_ISVEHICLE) && targ.owner) victim = targ.owner; @@ -846,9 +810,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if(g_minstagib) if(victim.items & IT_STRENGTH) yoda = 1; - - if(deathtype & HITTYPE_HEADSHOT) - headshot = 1; } } }