}
}
+MUTATOR_HOOKFUNCTION(cts, PlayerDamaged)
+{
+ int frag_deathtype = M_ARGV(5, int);
+ if (frag_deathtype == DEATH_KILL.m_id)
+ M_ARGV(0, bool) = true; // forbid_damage_logging
+}
+
MUTATOR_HOOKFUNCTION(cts, PlayerDies)
{
entity frag_target = M_ARGV(2, entity);
}
}
+MUTATOR_HOOKFUNCTION(rc, PlayerDamaged)
+{
+ int frag_deathtype = M_ARGV(5, int);
+ if (frag_deathtype == DEATH_KILL.m_id)
+ M_ARGV(0, bool) = true; // forbid_damage_logging
+}
+
MUTATOR_HOOKFUNCTION(rc, PlayerDies)
{
entity frag_target = M_ARGV(2, entity);
/** location */ i(vector, MUTATOR_ARGV_4_vector) \
/** deathtype */ i(int, MUTATOR_ARGV_5_int) \
/** potential_damage */ i(float, MUTATOR_ARGV_6_float) \
+ /** forbid_damage_logging */ o(bool, MUTATOR_ARGV_0_bool) \
/**/
MUTATOR_HOOKABLE(PlayerDamaged, EV_PlayerDamaged);
this.v_angle_y = this.v_angle.y + (random() * 2 - 1) * shake;
this.v_angle_x = bound(-90, this.v_angle.x, 90);
}
-
- 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))
- {
- if (IS_PLAYER(attacker) && DIFF_TEAM(attacker, this) && deathtype != DEATH_KILL.m_id) {
- GameRules_scoring_add(attacker, DMG, realdmg);
- }
- // don't count DEATH_KILL damage in game modes where suicide is for respawning
- // TODO mutator hook?
- if (deathtype != DEATH_KILL.m_id || !(IS_GAMETYPE(RACE) || IS_GAMETYPE(CTS)))
- if (IS_PLAYER(this)) {
- GameRules_scoring_add(this, DMGTAKEN, realdmg);
- }
- }
}
else
this.max_armorvalue += (save + take);
WeaponStats_LogDamage(awep.m_id, abot, this.(weaponentity).m_weapon.m_id, vbot, dh + da);
}
+ bool forbid_damage_logging = false;
MUTATOR_CALLHOOK(PlayerDamaged, attacker, this, dh, da, hitloc, deathtype, damage);
+ forbid_damage_logging = M_ARGV(0, bool);
+
+ if ((dh || da) && !forbid_damage_logging)
+ {
+ 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))
+ {
+ if (IS_PLAYER(attacker) && DIFF_TEAM(attacker, this) && deathtype != DEATH_KILL.m_id)
+ GameRules_scoring_add(attacker, DMG, realdmg);
+ if (IS_PLAYER(this))
+ GameRules_scoring_add(this, DMGTAKEN, realdmg);
+ }
+ }
if (GetResource(this, RES_HEALTH) < 1)
{