]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/vote.qc
Net: purge SELFPARAM from sendfuncs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qc
index 4be48e124e82b98d38fb26c41c5df7dfe18efc29..c92ffd3e82a31dd065d8bd288a97b4cb0f71febe 100644 (file)
@@ -24,7 +24,7 @@
 // =============================================
 
 //  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;
@@ -348,52 +348,60 @@ void VoteThink()
 
 // 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
@@ -418,12 +426,12 @@ void reset_map(float dorespawn)
        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();