// =============================================
// Nagger for players to know status of voting
-float Nagger_SendEntity(entity to, float sendflags)
+bool Nagger_SendEntity(entity this, entity to, float sendflags)
{
int nags, i, f, b;
entity e;
// Resets the state of all clients, items, weapons, waypoints, ... of the map.
void reset_map(float dorespawn)
-{
- entity oldself;
- oldself = self;
+{SELFPARAM();
if(time <= game_starttime && round_handler_IsActive())
round_handler_Reset(game_starttime);
MUTATOR_CALLHOOK(reset_map_global);
- for(self = world; (self = nextent(self)); )
- if(IS_NOT_A_CLIENT(self))
+ for(entity e = world; (e = nextent(e)); )
{
- if(self.reset)
+ setself(e);
+ if(IS_NOT_A_CLIENT(self))
{
- self.reset();
- continue;
- }
+ if(self.reset)
+ {
+ self.reset();
+ continue;
+ }
- if(self.team_saved)
- self.team = self.team_saved;
+ if(self.team_saved)
+ self.team = self.team_saved;
- if(self.flags & FL_PROJECTILE) // remove any projectiles left
- remove(self);
+ if(self.flags & FL_PROJECTILE) // remove any projectiles left
+ remove(self);
+ }
}
// Waypoints and assault start come LAST
- for(self = world; (self = nextent(self)); )
- if(IS_NOT_A_CLIENT(self))
+ for(entity e = world; (e = nextent(e)); )
{
- if(self.reset2)
+ setself(e);
+ if(IS_NOT_A_CLIENT(self))
{
- self.reset2();
- continue;
+ if(self.reset2)
+ {
+ self.reset2();
+ continue;
+ }
}
}
- FOR_EACH_PLAYER(self)
- if(self.frozen)
- Unfreeze(self);
+ entity e;
+ FOR_EACH_PLAYER(e)
+ if(e.frozen)
+ {
+ WITH(entity, self, e, Unfreeze(self));
+ }
// Moving the player reset code here since the player-reset depends
// on spawnpoint entities which have to be reset first --blub
if(dorespawn)
if(!MUTATOR_CALLHOOK(reset_map_players))
- FOR_EACH_CLIENT(self) // reset all players
+ FOR_EACH_CLIENT(e) // reset all players
{
+ setself(e);
/*
only reset players if a restart countdown is active
this can either be due to cvar sv_ready_restart_after_countdown having set
if(g_keyhunt)
kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round + (game_starttime - time), kh_StartRound);
- self = oldself;
+ setself(this);
}
// Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown is set)
void ReadyRestart_think()
-{
+{SELFPARAM();
restart_mapalreadyrestarted = 1;
reset_map(true);
Score_ClearAll();