]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
CA: make use of mutator hook MakePlayerObserver (code shifted in cl_client.qc breaks...
authorterencehill <piuntn@gmail.com>
Wed, 26 Dec 2012 16:32:26 +0000 (17:32 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 26 Dec 2012 16:32:26 +0000 (17:32 +0100)
qcsrc/server/cl_client.qc
qcsrc/server/mutators/gamemode_ca.qc

index 35f678e2d232b8e14bb390619ed008cdd0ec7c26..fda52868a805b076199838ae33fe82479fb67698 100644 (file)
@@ -401,6 +401,29 @@ void PutObserverInServer (void)
                WriteEntity(MSG_ONE, self);
        }
 
+       if(g_arena)
+       {
+               if(self.version_mismatch)
+               {
+                       Spawnqueue_Unmark(self);
+                       Spawnqueue_Remove(self);
+               }
+               else
+               {
+                       Spawnqueue_Insert(self);
+               }
+       }
+       else if(g_lms)
+       {
+               // Only if the player cannot play at all
+               if(PlayerScore_Add(self, SP_LMS_RANK, 0) == 666)
+                       self.frags = FRAGS_SPECTATOR;
+               else
+                       self.frags = FRAGS_LMS_LOSER;
+       }
+       else
+               self.frags = FRAGS_SPECTATOR;
+
        DropAllRunes(self);
        MUTATOR_CALLHOOK(MakePlayerObserver);
 
@@ -506,36 +529,6 @@ void PutObserverInServer (void)
        self.punchvector = '0 0 0';
        self.oldvelocity = self.velocity;
        self.fire_endtime = -1;
-
-       if(g_arena)
-       {
-               if(self.version_mismatch)
-               {
-                       Spawnqueue_Unmark(self);
-                       Spawnqueue_Remove(self);
-               }
-               else
-               {
-                       Spawnqueue_Insert(self);
-               }
-       }
-       else if(g_lms)
-       {
-               // Only if the player cannot play at all
-               if(PlayerScore_Add(self, SP_LMS_RANK, 0) == 666)
-                       self.frags = FRAGS_SPECTATOR;
-               else
-                       self.frags = FRAGS_LMS_LOSER;
-       }
-       else if(g_ca)
-       {
-               if(self.caplayer)
-                       self.frags = FRAGS_LMS_LOSER;
-               else
-                       self.frags = FRAGS_SPECTATOR;
-       }
-       else
-               self.frags = FRAGS_SPECTATOR;
 }
 
 .float model_randomizer;
index 51daf6f2ea286c1b0d275280aebe301a2621a35a..330659572f6bcd3b289bee4bc7abb0d9dc6d5515 100644 (file)
@@ -190,6 +190,13 @@ MUTATOR_HOOKFUNCTION(ca_ForbidPlayerScore_Clear)
        return 1;
 }
 
+MUTATOR_HOOKFUNCTION(ca_MakePlayerObserver)
+{
+       if(self.caplayer)
+               self.frags = FRAGS_LMS_LOSER;
+       return 1;
+}
+
 MUTATOR_HOOKFUNCTION(ca_ForbidThrowCurrentWeapon)
 {
        return 1;
@@ -211,6 +218,7 @@ MUTATOR_DEFINITION(gamemode_ca)
 {
        MUTATOR_HOOK(PlayerSpawn, ca_PlayerSpawn, CBC_ORDER_ANY);
        MUTATOR_HOOK(PutClientInServer, ca_PutClientInServer, CBC_ORDER_ANY);
+       MUTATOR_HOOK(MakePlayerObserver, ca_MakePlayerObserver, CBC_ORDER_ANY);
        MUTATOR_HOOK(reset_map_global, ca_reset_map_global, CBC_ORDER_ANY);
        MUTATOR_HOOK(reset_map_players, ca_reset_map_players, CBC_ORDER_ANY);
        MUTATOR_HOOK(GetTeamCount, ca_GetTeamCount, CBC_ORDER_EXCLUSIVE);