]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 296340ed707931e8364f3b30a7f5c13491e03c6e..9f2174addc0b5eeb4cb85c30b70e4f5d22567054 100644 (file)
@@ -2404,9 +2404,6 @@ void PlayerPreThink (void)
 
                if(frametime)
                        player_anim();
-
-               if(g_nexball)
-                       nexball_setstatus();
                
                // secret status
                secrets_setstatus();
index ea7360835e38f8b8d7ff5cee835440cfd6a93715..805f200bb682786585997fe4a837920d0da42766 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 78d9d707689b5ce2332287daa108aa67e00fa0b2..adfb31a1b57112685e62e9ddfa04dd2337cfedba 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
        {