// appends ", Mutator name" to ret_string for display
// INPUT, OUTPUT:
string ret_string;
+
+MUTATOR_HOOKABLE(CustomizeWaypoint);
+ // called every frame
+ // customizes the waypoint for spectators
+ // INPUT: self = waypoint, other = player, other.enemy = spectator
MUTATOR_HOOKABLE(FilterItem);
// checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
return TRUE;
}
+MUTATOR_HOOKFUNCTION(minstagib_CustomizeWaypoint)
+{
+ entity e = WaypointSprite_getviewentity(other);
+
+ // if you have the invisibility powerup, sprites ALWAYS are restricted to your team
+ // but only apply this to real players, not to spectators
+ if((self.owner.flags & FL_CLIENT) && (self.owner.items & IT_STRENGTH) && (e == other))
+ if(IsDifferentTeam(self.owner, e))
+ return TRUE;
+
+ return FALSE;
+}
+
MUTATOR_HOOKFUNCTION(minstagib_ItemCountdown)
{
switch(self.items)
MUTATOR_HOOK(SetStartItems, minstagib_SetStartItems, CBC_ORDER_ANY);
MUTATOR_HOOK(Item_GiveTo, minstagib_GiveItem, CBC_ORDER_ANY);
MUTATOR_HOOK(FilterItem, minstagib_FilterItem, CBC_ORDER_ANY);
+ MUTATOR_HOOK(CustomizeWaypoint, minstagib_CustomizeWaypoint, CBC_ORDER_ANY);
MUTATOR_HOOK(Item_RespawnCountdown, minstagib_ItemCountdown, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, minstagib_SplitHealthArmor, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerPowerups, minstagib_PlayerPowerups, CBC_ORDER_ANY);
// make spectators see what the player would see
entity e;
e = WaypointSprite_getviewentity(other);
-
- // as a GENERAL rule:
- // if you have the invisibility powerup, sprites ALWAYS are restricted to your team
- // but only apply this to real players, not to spectators
- if(g_minstagib && (self.owner.flags & FL_CLIENT) && (self.owner.items & IT_STRENGTH) && (e == other))
- {
- if(!WaypointSprite_isteammate(self.owner, e))
- return FALSE;
- }
+
+ if(MUTATOR_CALLHOOK(CustomizeWaypoint))
+ return FALSE;
return self.waypointsprite_visible_for_player(e);
}