{
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
- float frag_damage = M_ARGV(4, float);
- vector frag_force = M_ARGV(6, vector);
+
+ // as a gamemode rule, only apply scaling to player versus player combat
+ if(!IS_PLAYER(frag_attacker) || !IS_PLAYER(frag_target))
+ return;
if(frag_attacker.ballcarried) // if the attacker is a ballcarrier
{
if(frag_target == frag_attacker) // damage done to yourself
{
- frag_damage *= autocvar_g_keepaway_ballcarrier_selfdamage;
- frag_force *= autocvar_g_keepaway_ballcarrier_selfforce;
+ M_ARGV(4, float) *= autocvar_g_keepaway_ballcarrier_selfdamage;
+ M_ARGV(6, vector) *= autocvar_g_keepaway_ballcarrier_selfforce;
}
else // damage done to noncarriers
{
- frag_damage *= autocvar_g_keepaway_ballcarrier_damage;
- frag_force *= autocvar_g_keepaway_ballcarrier_force;
+ M_ARGV(4, float) *= autocvar_g_keepaway_ballcarrier_damage;
+ M_ARGV(6, vector) *= autocvar_g_keepaway_ballcarrier_force;
}
}
- else if (IS_PLAYER(frag_attacker) && !frag_target.ballcarried) // if the target is a noncarrier
+ else // if the target is a noncarrier
{
if(frag_target == frag_attacker) // damage done to yourself
{
- frag_damage *= autocvar_g_keepaway_noncarrier_selfdamage;
- frag_force *= autocvar_g_keepaway_noncarrier_selfforce;
+ M_ARGV(4, float) *= autocvar_g_keepaway_noncarrier_selfdamage;
+ M_ARGV(6, vector) *= autocvar_g_keepaway_noncarrier_selfforce;
}
else // damage done to other noncarriers
{
- frag_damage *= autocvar_g_keepaway_noncarrier_damage;
- frag_force *= autocvar_g_keepaway_noncarrier_force;
+ M_ARGV(4, float) *= autocvar_g_keepaway_noncarrier_damage;
+ M_ARGV(6, vector) *= autocvar_g_keepaway_noncarrier_force;
}
}
-
- M_ARGV(4, float) = frag_damage;
- M_ARGV(6, vector) = frag_force;
}
MUTATOR_HOOKFUNCTION(ka, ClientDisconnect)