From 10552b59582977d4bf93a13af15a01c011899d3b Mon Sep 17 00:00:00 2001 From: div0 Date: Thu, 30 Mar 2006 09:01:30 +0000 Subject: [PATCH] NixNex no longer honors g_start_weapon_laser but now g_nixnex_with_laser instead; added this setting to the menu. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1202 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/default.cfg | 2 +- data/menu/creategame/gamemodes/gamemisc.menu | 5 +++++ data/menu/data/gamemodes/gamemisc.menu | 7 +++++++ data/qcsrc/server/gamec/cl_weapons.c | 6 +++--- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/data/default.cfg b/data/default.cfg index b7a8bca5f..794889037 100644 --- a/data/default.cfg +++ b/data/default.cfg @@ -604,8 +604,8 @@ set urrebots_navopt "0" // NixNex (No-Items x Nexuiz) - at each time, everyone uses the same weapon, // and in regular intervals, this weapon is cycled -// you might want this: set g_start_weapon_laser 0 set g_nixnex 0 +set g_nixnex_with_laser 0 // TODO these need balancing: set g_balance_nixnex_roundtime 25 set g_balance_nixnex_incrtime 1.6 diff --git a/data/menu/creategame/gamemodes/gamemisc.menu b/data/menu/creategame/gamemodes/gamemisc.menu index 7d8266d9a..d641a745f 100644 --- a/data/menu/creategame/gamemodes/gamemisc.menu +++ b/data/menu/creategame/gamemodes/gamemisc.menu @@ -229,6 +229,11 @@ Item Layout Misc text "NixNex (No Items Nexuiz)" target "::Data::Game::Misc::NixNex::Switch" } + Derive Nex_Option_Switch NixNexWithLaser + { + text "Always carry laser" + target "::Data::Game::Misc::NixNexWithLaser::Switch" + } Derive Nex_Option_EditBox NixNexRoundTime { text "Time between weapon switches" diff --git a/data/menu/data/gamemodes/gamemisc.menu b/data/menu/data/gamemodes/gamemisc.menu index 637f85edd..1b4b5bf03 100644 --- a/data/menu/data/gamemodes/gamemisc.menu +++ b/data/menu/data/gamemodes/gamemisc.menu @@ -221,6 +221,13 @@ Item DataContainer Misc [DataLink_Setting] } + Item Data_Cvar NixNexWithLaser + { + cvarName "g_nixnex_with_laser" + defValue 0 + + [DataLink_OnOffSwitch] + } Item Data_Cvar MidAir { cvarName "g_midair" diff --git a/data/qcsrc/server/gamec/cl_weapons.c b/data/qcsrc/server/gamec/cl_weapons.c index a18ab87a7..7dda79da5 100644 --- a/data/qcsrc/server/gamec/cl_weapons.c +++ b/data/qcsrc/server/gamec/cl_weapons.c @@ -360,11 +360,11 @@ void Nixnex_ChooseNextWeapon() { float numberof, id; numberof = WEP_LAST - WEP_FIRST; // all but the current one - if(cvar("g_start_weapon_laser")) + if(cvar("g_nixnex_with_laser")) numberof = numberof - 1; id = WEP_FIRST + ceil(random() * numberof) - 1; - if(cvar("g_start_weapon_laser")) // skip the laser if needed + if(cvar("g_nixnex_with_laser")) // skip the laser if needed id = id + 1; if(id >= nixnex_weapon) // skip the current weapon @@ -456,7 +456,7 @@ void Nixnex_GiveCurrentWeapon() } self.items = self.items - (self.items & (IT_LASER | IT_SHOTGUN | IT_UZI | IT_GRENADE_LAUNCHER | IT_ELECTRO | IT_CRYLINK | IT_NEX | IT_HAGAR | IT_ROCKET_LAUNCHER)); - if(cvar("g_start_weapon_laser")) + if(cvar("g_nixnex_with_laser")) self.items = self.items + IT_LASER; self.items = self.items - (self.items & weapon_translateindextoflag(nixnex_weapon)) + weapon_translateindextoflag(nixnex_weapon); -- 2.39.2