]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/player.qc
Merge branch 'DefaultUser/more_damagetext' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / player.qc
index f2ceecf9ee4596d1cc9125da2dc7513f69f13c25..904447c218418c936f5f933cce7cf13062813c61 100644 (file)
@@ -62,6 +62,8 @@ void CopyBody(entity this, float keepvelocity)
        clone.iscreature = this.iscreature;
        clone.teleportable = this.teleportable;
        clone.damagedbycontents = this.damagedbycontents;
+       if(clone.damagedbycontents)
+               IL_PUSH(g_damagedbycontents, clone);
        clone.angles = this.angles;
        clone.v_angle = this.v_angle;
        clone.avelocity = this.avelocity;
@@ -126,6 +128,8 @@ void CopyBody(entity this, float keepvelocity)
        animdecide_load_if_needed(clone);
        animdecide_setframes(clone, false, frame, frame1time, frame2, frame2time);
 
+       IL_PUSH(g_clones, clone);
+
        MUTATOR_CALLHOOK(CopyBody, this, clone, keepvelocity);
 }
 
@@ -210,6 +214,8 @@ void PlayerCorpseDamage(entity this, entity inflictor, entity attacker, float da
                this.alpha = -1;
                this.solid = SOLID_NOT; // restore later
                this.takedamage = DAMAGE_NO; // restore later
+               if(this.damagedbycontents)
+                       IL_REMOVE(g_damagedbycontents, this);
                this.damagedbycontents = false;
        }
 }
@@ -503,9 +509,9 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
        {
                WeaponStats_LogDamage(awep.m_id, abot, PS(this).m_weapon.m_id, vbot, dh + da);
        }
-       if (dh + da)
+       if (damage)
        {
-               MUTATOR_CALLHOOK(PlayerDamaged, attacker, this, dh, da, hitloc, deathtype);
+               MUTATOR_CALLHOOK(PlayerDamaged, attacker, this, dh, da, hitloc, deathtype, damage);
        }
 
        if (this.health < 1)
@@ -553,9 +559,8 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
 
         // increment frag counter for used weapon type
         Weapon w = DEATH_WEAPONOF(deathtype);
-        if(w != WEP_Null)
-       if(accuracy_isgooddamage(attacker, this))
-        attacker.accuracy.(accuracy_frags[w.m_id-1]) += 1;
+               if(w != WEP_Null && accuracy_isgooddamage(attacker, this))
+                       attacker.accuracy.(accuracy_frags[w.m_id-1]) += 1;
 
                MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype, damage);
                excess = M_ARGV(4, float);
@@ -683,7 +688,7 @@ void dedicated_print(string input)
  */
 int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol)
 {
-       if (!teamsay && !privatesay) if (substring(msgin, 0, 1) == " ")
+       if (!teamsay && !privatesay && substring(msgin, 0, 1) == " ")
         msgin = substring(msgin, 1, -1); // work around DP say bug (say_team does not have this!)
 
        msgin = formatmessage(source, msgin);