Move some nexball checks into mutator hooks
authorMario <mario.mario@y7mail.com>
Thu, 6 Jun 2013 19:24:28 +0000 (05:24 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 6 Jun 2013 19:24:28 +0000 (05:24 +1000)
qcsrc/server/cl_client.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_nexball.qc

index 296340e..9f2174a 100644 (file)
@@ -2404,9 +2404,6 @@ void PlayerPreThink (void)
 
                if(frametime)
                        player_anim();
-
-               if(g_nexball)
-                       nexball_setstatus();
                
                // secret status
                secrets_setstatus();
index ea73608..805f200 100644 (file)
@@ -788,10 +788,7 @@ void readplayerstartcvars()
 
        if(!cvar("g_use_ammunition"))
                start_items |= IT_UNLIMITED_AMMO;
-
-       if(cvar("g_nexball"))
-               start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
-
+       
        if(start_items & IT_UNLIMITED_WEAPON_AMMO)
        {
                start_ammo_rockets = 999;
index 78d9d70..adfb31a 100644 (file)
@@ -929,6 +929,9 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
                }
                
        }
+       
+       nexball_setstatus();
+       
        return FALSE;
 }
 
@@ -944,6 +947,13 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
        return FALSE;
 }
 
+MUTATOR_HOOKFUNCTION(nexball_SetStartItems)
+{
+       start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
+       
+       return FALSE;
+}
+
 MUTATOR_DEFINITION(gamemode_nexball)
 {
        MUTATOR_HOOK(PlayerDies, nexball_BallDrop, CBC_ORDER_ANY);
@@ -953,6 +963,7 @@ MUTATOR_DEFINITION(gamemode_nexball)
        MUTATOR_HOOK(BuildMutatorsString, nexball_BuildMutatorsString, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerSpawn, nexball_PlayerSpawn, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerPreThink, nexball_PlayerPreThink, CBC_ORDER_ANY);
+       MUTATOR_HOOK(SetStartItems, nexball_SetStartItems, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {