GameRules_scoring_add_float2int(scorer, SCORE, scorer_damage, ca_damage_counter, autocvar_g_ca_damage2score);
}
-MUTATOR_HOOKFUNCTION(ca, CalculateRespawnTime)
+MUTATOR_HOOKFUNCTION(ca, CalculateRespawnTime, CBC_ORDER_EXCLUSIVE)
{
// no respawn calculations needed, player is forced to spectate anyway
return true;
lms_UpdateLeaders();
}
-MUTATOR_HOOKFUNCTION(lms, CalculateRespawnTime)
+MUTATOR_HOOKFUNCTION(lms, CalculateRespawnTime, CBC_ORDER_EXCLUSIVE)
{
entity player = M_ARGV(0, entity);
player.respawn_flags |= RESPAWN_FORCE;
M_ARGV(1, float) = 0; // don't report that the player has killed or been killed, that would out them as a hunter!
}
-MUTATOR_HOOKFUNCTION(surv, CalculateRespawnTime)
+MUTATOR_HOOKFUNCTION(surv, CalculateRespawnTime, CBC_ORDER_EXCLUSIVE)
{
// no respawn calculations needed, player is forced to spectate anyway
return true;
LOG_DEBUGF("Newly spawned player %i with respawntime factor %f", player, player.killers_spawn_faster_factor);
}
-MUTATOR_HOOKFUNCTION(mutator_killers_spawn_faster, PlayerDies) {
+MUTATOR_HOOKFUNCTION(mutator_killers_spawn_faster, GiveFragsForKill, CBC_ORDER_FIRST) {
// Note: this runs BEFORE CalculateRespawnTime.
- entity attacker = M_ARGV(1, entity);
- entity target = M_ARGV(2, entity);
- if (target.classname == "body") {
- error("WAT");
+ entity attacker = M_ARGV(0, entity);
+ float frags = M_ARGV(2, float);
+ if (frags < 0) {
+ // Suicide, teamkill or similar.
+ // As the frags amount is an inout parameter, this must be CBC_ORDER_FIRST.
return false;
}
attacker.killers_spawn_faster_factor = killers_spawn_faster_adjust(
MUTATOR_HOOKFUNCTION(mutator_killers_spawn_faster, PlayerDied) {
// Note: this runs AFTER CalculateRespawnTime.
entity player = M_ARGV(0, entity);
- if (player.classname == "body") {
- error("WAT");
- return false;
- }
player.killers_spawn_faster_factor = killers_spawn_faster_adjust(
player.killers_spawn_faster_factor,
autocvar_g_killers_spawn_faster_death_modifier);