return true;
}
+MUTATOR_HOOKFUNCTION(nb, DropSpecialItems)
+{
+ if(frag_target.ballcarried)
+ DropBall(frag_target.ballcarried, frag_target.origin, frag_target.velocity);
+
+ return false;
+}
+
REGISTER_MUTATOR(nb, g_nexball)
{
ActivateTeamplay();
#include "../common/animdecide.qh"
+void Drop_Special_Items(entity player)
+{
+ // called when the player has become stuck or frozen
+ // so objective items aren't stuck with the player
+
+ MUTATOR_CALLHOOK(DropSpecialItems, player);
+}
+
void CopyBody_Think(void)
{SELFPARAM();
if(self.CopyBody_nextthink && time > self.CopyBody_nextthink)
/**/ o(string, ret_string) \
/**/
MUTATOR_HOOKABLE(SetWeaponArena, EV_SetWeaponArena);
+
+#define EV_DropSpecialItems(i, o) \
+ /**/ i(entity, frag_target) \
+ /**/
+MUTATOR_HOOKABLE(DropSpecialItems, EV_DropSpecialItems);
#endif
return false;
}
+MUTATOR_HOOKFUNCTION(ctf, DropSpecialItems)
+{
+ if(frag_target.flagcarried)
+ ctf_Handle_Throw(frag_target, world, DROP_THROW);
+
+ return false;
+}
+
// ==========
// Spawnfuncs
return true;
}
+MUTATOR_HOOKFUNCTION(ka, DropSpecialItems)
+{
+ if(frag_target.ballcarried)
+ ka_DropEvent(frag_target);
+
+ return false;
+}
+
// ==============
// Initialization
return true;
}
+MUTATOR_HOOKFUNCTION(kh, DropSpecialItems)
+{
+ kh_Key_DropAll(frag_target, false);
+ return false;
+}
+
REGISTER_MUTATOR(kh, g_keyhunt)
{
ActivateTeamplay();
frost_target.frozen_by = freezefield.realowner;
Send_Effect(EFFECT_ELECTRO_IMPACT, frost_target.origin, '0 0 0', 1);
Freeze(frost_target, 1/freeze_time, 3, false);
- if(frost_target.ballcarried)
- if(g_keepaway) { ka_DropEvent(frost_target); }
- else { DropBall(frost_target.ballcarried, frost_target.origin, frost_target.velocity);}
- if(frost_target.flagcarried) { ctf_Handle_Throw(frost_target, world, DROP_THROW); }
- if(frost_target.nade) { toss_nade(frost_target, '0 0 0', time + 0.05); }
- kh_Key_DropAll(frost_target, false);
+ Drop_Special_Items(frost_target);
}
void nade_ice_think()
return false;
}
+MUTATOR_HOOKFUNCTION(nades, DropSpecialItems)
+{
+ if(frag_target.nade)
+ toss_nade(frag_target, '0 0 0', time + 0.05);
+
+ return false;
+}
+
bool nades_RemovePlayer()
{SELFPARAM();
nades_Clear(self);