- MUTATOR_CALLHOOK(PlayerDamaged, attacker, this, dh, da, hitloc, deathtype, damage);
+ bool forbid_logging_damage = MUTATOR_CALLHOOK(PlayerDamaged, attacker, this, dh, da, hitloc, deathtype, damage);
+
+ if ((dh || da) && !forbid_logging_damage)
+ {
+ float realdmg = damage - excess;
+ if ((this != attacker || deathtype == DEATH_KILL.m_id) && realdmg && !STAT(FROZEN, this)
+ && (!(round_handler_IsActive() && !round_handler_IsRoundStarted()) && time >= game_starttime))
+ {
+ // accumulate damage, it will be logged later in this frame
+ if (IS_PLAYER(attacker) && DIFF_TEAM(attacker, this) && deathtype != DEATH_KILL.m_id)
+ attacker.score_frame_dmg += realdmg;
+ if (IS_PLAYER(this))
+ this.score_frame_dmgtaken += realdmg;
+ }
+ }