]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove redundant g_players intrusive list
authorbones_was_here <bones_was_here@xonotic.au>
Fri, 11 Aug 2023 18:02:09 +0000 (04:02 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Fri, 11 Aug 2023 18:02:09 +0000 (04:02 +1000)
qcsrc/server/client.qh
qcsrc/server/main.qc

index bd42503250027f29e0879607ae93296dcc5513f4..f982955ddfbbd7851a8bf9be66a482f55f0eb135 100644 (file)
@@ -83,9 +83,6 @@ float autocvar_sv_player_scale;
 
 void ClientState_attach(entity this);
 
-IntrusiveList g_players;
-STATIC_INIT(g_players) { g_players = IL_NEW(); }
-
 CLASS(Client, Object)
     /** Client name */
     ATTRIB(Client, netname, string, this.netname);
@@ -278,10 +275,8 @@ CLASS(Player, Client)
 
     INIT(Player) {
         this.classname = STR_PLAYER;
-        IL_PUSH(g_players, this);
     }
     DESTRUCTOR(Player) {
-        IL_REMOVE(g_players, this);
     }
 ENDCLASS(Player)
 
index 40f4d6c2f58e176a71f806dbbb0c4a99663c733b..03306e76d7e0f4019657c2259a74c7caee1f2410 100644 (file)
@@ -288,9 +288,12 @@ void systems_update();
 void sys_phys_update(entity this, float dt);
 void StartFrame()
 {
-       // TODO: if move is more than 50ms, split it into two moves (this matches QWSV behavior and the client prediction)
-       IL_EACH(g_players, IS_FAKE_CLIENT(it), sys_phys_update(it, frametime));
-       IL_EACH(g_players, IS_FAKE_CLIENT(it), PlayerPreThink(it));
+       FOREACH_CLIENT(IS_FAKE_CLIENT(it),
+       {
+               // DP calls these for real clients only
+               sys_phys_update(it, frametime); // called by SV_PlayerPhysics for players
+               PlayerPreThink(it);
+       });
 
        execute_next_frame();
        if (autocvar_sv_autopause && !server_is_dedicated) Pause_TryPause();
@@ -356,8 +359,12 @@ void StartFrame()
        MUTATOR_CALLHOOK(SV_StartFrame);
 
        GlobalStats_updateglobal();
-       FOREACH_CLIENT(true, GlobalStats_update(it));
-       IL_EACH(g_players, IS_FAKE_CLIENT(it), PlayerPostThink(it));
+       FOREACH_CLIENT(true,
+       {
+               GlobalStats_update(it);
+               if (IS_FAKE_CLIENT(it))
+                       PlayerPostThink(it); // DP calls this for real clients only
+       });
 }
 
 .vector originjitter;