Send_KillNotification(a, s, msg, deathtype, MSG_KILL);
- if(g_ctf && targ.flagcarried)
- {
- UpdateFrags(attacker, ctf_ReadScore("score_kill")); // FIXCTF
- PlayerScore_Add(attacker, SP_CTF_FCKILLS, 1);
- GiveFrags(attacker, targ, 0, deathtype); // for logging
- }
- else
- GiveFrags(attacker, targ, 1, deathtype);
+ GiveFrags(attacker, targ, 1, deathtype);
if (targ.killcount > 2) {
Send_KillNotification(s, ftos(targ.killcount), a, KILL_END_SPREE, MSG_SPREE);
// Hook Functions
// ==============
-MUTATOR_HOOKFUNCTION(ctf_RemovePlayer)
-{
- if(self.flagcarried)
- { ctf_Handle_Throw(self, world, DROP_NORMAL); }
-
- return 0;
-}
-
-MUTATOR_HOOKFUNCTION(ctf_PortalTeleport)
-{
- if(self.flagcarried)
- if(!autocvar_g_ctf_portalteleport)
- { ctf_Handle_Throw(self, world, DROP_NORMAL); }
-
- return 0;
-}
-
MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink)
{
entity flag;
return 0;
}
+MUTATOR_HOOKFUNCTION(ctf_PlayerDies)
+{
+ if((frag_attacker != frag_target) && (frag_attacker.classname == "player") && (frag_target.flagcarried))
+ {
+ PlayerTeamScore_AddScore(frag_attacker, ctf_ReadScore("score_kill"));
+ PlayerScore_Add(frag_attacker, SP_CTF_FCKILLS, 1);
+ }
+
+ if(frag_target.flagcarried)
+ { ctf_Handle_Throw(frag_target, world, DROP_NORMAL); }
+
+ return 0;
+}
+
MUTATOR_HOOKFUNCTION(ctf_GiveFragsForKill)
{
frag_score = 0;
return (autocvar_g_ctf_ignore_frags); // no frags counted in ctf if this is true
}
+MUTATOR_HOOKFUNCTION(ctf_RemovePlayer)
+{
+ if(self.flagcarried)
+ { ctf_Handle_Throw(self, world, DROP_NORMAL); }
+
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ctf_PortalTeleport)
+{
+ if(self.flagcarried)
+ if(!autocvar_g_ctf_portalteleport)
+ { ctf_Handle_Throw(self, world, DROP_NORMAL); }
+
+ return 0;
+}
+
MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
{
entity player = self;
{
MUTATOR_HOOK(MakePlayerObserver, ctf_RemovePlayer, CBC_ORDER_ANY);
MUTATOR_HOOK(ClientDisconnect, ctf_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, ctf_RemovePlayer, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerDies, ctf_PlayerDies, CBC_ORDER_ANY);
MUTATOR_HOOK(PortalTeleport, ctf_PortalTeleport, CBC_ORDER_ANY);
MUTATOR_HOOK(GiveFragsForKill, ctf_GiveFragsForKill, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerPreThink, ctf_PlayerPreThink, CBC_ORDER_ANY);