]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Purge self from the damage/death mutator hooks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index 85044c27409c948609d42a47f7aec70d0983816c..3b04a492217d062c5188859dea37909cc8b612f3 100644 (file)
@@ -95,7 +95,7 @@ void CopyBody(entity this, float keepvelocity)
        clone.solid = this.solid;
        clone.ballistics_density = this.ballistics_density;
        clone.takedamage = this.takedamage;
-       clone.customizeentityforclient = this.customizeentityforclient;
+       setcefc(clone, getcefc(this));
        clone.uncustomizeentityforclient = this.uncustomizeentityforclient;
        clone.uncustomizeentityforclient_set = this.uncustomizeentityforclient_set;
        if (keepvelocity == 1)
@@ -384,10 +384,9 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                save = v.y;
        }
 
-       frag_damage = damage;
-       MUTATOR_CALLHOOK(PlayerDamage_SplitHealthArmor, inflictor, attacker, this, force, take, save);
-       take = bound(0, damage_take, this.health);
-       save = bound(0, damage_save, this.armorvalue);
+       MUTATOR_CALLHOOK(PlayerDamage_SplitHealthArmor, inflictor, attacker, this, force, take, save, deathtype, damage);
+       take = bound(0, M_ARGV(4, float), this.health);
+       save = bound(0, M_ARGV(5, float), this.armorvalue);
        excess = max(0, damage - take - save);
 
        if(sound_allowed(MSG_BROADCAST, attacker))
@@ -552,8 +551,8 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
        if(accuracy_isgooddamage(attacker, this))
         attacker.accuracy.(accuracy_frags[w.m_id-1]) += 1;
 
-               MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype);
-               excess = frag_damage;
+               MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype, excess);
+               excess = M_ARGV(4, float);
 
                Weapon wep = PS(this).m_weapon;
                WITHSELF(this, wep.wr_playerdeath(wep, this));
@@ -675,7 +674,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
        if (!teamsay && !privatesay) if (substring(msgin, 0, 1) == " ")
         msgin = substring(msgin, 1, -1); // work around DP say bug (say_team does not have this!)
 
-       msgin = formatmessage(msgin);
+       msgin = formatmessage(source, msgin);
 
     string colorstr;
        if (!IS_PLAYER(source))