From: Mario Date: Mon, 23 Mar 2015 00:57:04 +0000 (+1100) Subject: Fix overkill powerups X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=25ab495c1a26258a6c81780e0857f6b9ce849607;p=xonotic%2Fxonotic-data.pk3dir.git Fix overkill powerups --- diff --git a/qcsrc/server/mutators/mutator_overkill.qc b/qcsrc/server/mutators/mutator_overkill.qc index fbc2db6e4..136caf668 100644 --- a/qcsrc/server/mutators/mutator_overkill.qc +++ b/qcsrc/server/mutators/mutator_overkill.qc @@ -202,41 +202,42 @@ MUTATOR_HOOKFUNCTION(ok_PlayerSpawn) MUTATOR_HOOKFUNCTION(ok_OnEntityPreSpawn) { - // powerups don't actually exist, so we can abuse them as much as we want - if(self.classname == "item_strength") + if(autocvar_g_powerups) + if(autocvar_g_overkill_powerups_replace) { - self.classname = "item_removing"; // avoid letting other mutators use it - entity wep = spawn(); - setorigin(wep, self.origin); - setmodel(wep, "models/weapons/g_ok_hmg.md3"); - wep.classname = "weapon_hmg"; - wep.ok_item = true; - wep.noalign = self.noalign; - wep.cnt = self.cnt; - wep.team = self.team; - wep.respawntime = autocvar_g_overkill_superguns_respawn_time; - wep.pickup_anyway = true; - wep.think = spawnfunc_weapon_hmg; - wep.nextthink = time + 0.1; - return true; - } + if(self.classname == "item_strength") + { + entity wep = spawn(); + setorigin(wep, self.origin); + setmodel(wep, "models/weapons/g_ok_hmg.md3"); + wep.classname = "weapon_hmg"; + wep.ok_item = true; + wep.noalign = self.noalign; + wep.cnt = self.cnt; + wep.team = self.team; + wep.respawntime = autocvar_g_overkill_superguns_respawn_time; + wep.pickup_anyway = true; + wep.think = spawnfunc_weapon_hmg; + wep.nextthink = time + 0.1; + return true; + } - if(self.classname == "item_invincible") - { - self.classname = "item_removing"; // avoid letting other mutators use it - entity wep = spawn(); - setorigin(wep, self.origin); - setmodel(wep, "models/weapons/g_ok_rl.md3"); - wep.classname = "weapon_rpc"; - wep.ok_item = true; - wep.noalign = self.noalign; - wep.cnt = self.cnt; - wep.team = self.team; - wep.respawntime = autocvar_g_overkill_superguns_respawn_time; - wep.pickup_anyway = true; - wep.think = spawnfunc_weapon_rpc; - wep.nextthink = time + 0.1; - return true; + if(self.classname == "item_invincible") + { + entity wep = spawn(); + setorigin(wep, self.origin); + setmodel(wep, "models/weapons/g_ok_rl.md3"); + wep.classname = "weapon_rpc"; + wep.ok_item = true; + wep.noalign = self.noalign; + wep.cnt = self.cnt; + wep.team = self.team; + wep.respawntime = autocvar_g_overkill_superguns_respawn_time; + wep.pickup_anyway = true; + wep.think = spawnfunc_weapon_rpc; + wep.nextthink = time + 0.1; + return true; + } } return false;