]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Arena: block players before the round start in a MUCH better way, like frozen players...
authorterencehill <piuntn@gmail.com>
Thu, 12 Jan 2012 12:03:26 +0000 (13:03 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 12 Jan 2012 12:03:26 +0000 (13:03 +0100)
qcsrc/server/arena.qc
qcsrc/server/cl_physics.qc
qcsrc/server/defs.qh

index a51da69ff041b1afc9051f69b789692ef2f58c7e..d9bcf5c3e1a802b7f554487f8beb709caa3872fc 100644 (file)
@@ -256,10 +256,7 @@ void Arena_Warmup()
                        FOR_EACH_CLIENT(e)
                        {
                                if(e.spawned && e.classname == "player")
-                                       e.movetype = MOVETYPE_NONE;
-                               e.velocity = '0 0 0';
-                               e.avelocity = '0 0 0';
-                               e.movement = '0 0 0';
+                                       e.blocked = 1;
                        }
                }
        }
@@ -278,10 +275,10 @@ void Arena_Warmup()
                }
 
                if(g_arena) {
-                       FOR_EACH_PLAYER(e)
+                       FOR_EACH_CLIENT(e)
                        {
-                               if(e.health > 0 && e.movetype == MOVETYPE_NONE)
-                                       e.movetype = MOVETYPE_WALK;
+                               if(e.blocked)
+                                       e.blocked = 0;
                        }
                }
        }
index 79087eb8a366e9a5ed91c67de9024d058ef3140f..2f714869a272ae86d0d5092dedb61c2b7ab45683 100644 (file)
@@ -875,6 +875,12 @@ void SV_PlayerPhysics()
 
        MUTATOR_CALLHOOK(PlayerPhysics);
 
+       if(self.blocked)
+       {
+               self.movement = '0 0 0';
+               self.disableclientprediction = 1;
+       }
+
        maxspd_mod = 1;
 
        swampspd_mod = 1;
index 865d39b10eef9c3369ca63942b29fbd771b09f43..f24cf2a4db018c1b1f777b6fa67aad930fb96705 100644 (file)
@@ -641,6 +641,8 @@ float serverflags;
 
 .float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
 
+.float blocked;
+
 .float freezetag_frozen;
 .float freezetag_revive_progress;