From: Mario Date: Thu, 6 Jun 2013 19:24:28 +0000 (+1000) Subject: Move some nexball checks into mutator hooks X-Git-Tag: xonotic-v0.8.0~366^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c5963ffbefc2eed5856f619e30763cd9403b3b38;p=xonotic%2Fxonotic-data.pk3dir.git Move some nexball checks into mutator hooks --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 296340ed7..9f2174add 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2404,9 +2404,6 @@ void PlayerPreThink (void) if(frametime) player_anim(); - - if(g_nexball) - nexball_setstatus(); // secret status secrets_setstatus(); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index ea7360835..805f200bb 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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; diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index 78d9d7076..adfb31a1b 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -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 {