From bad66b409c2bca2cbd5cec8577139f6830f2bd03 Mon Sep 17 00:00:00 2001 From: div0 Date: Sun, 31 Jan 2010 17:48:58 +0000 Subject: [PATCH] fix the "give NNN strength" command git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8599 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/t_items.qc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index 406e13b53..389acf88c 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -1615,12 +1615,12 @@ float GiveItems(entity e, float beginarg, float endarg) got = 0; _switchweapon = FALSE; - if (activator.autoswitch) - if (activator.switchweapon == w_getbestweapon(activator)) + if (e.autoswitch) + if (e.switchweapon == w_getbestweapon(e)) _switchweapon = TRUE; - activator.strength_finished = max(0, activator.strength_finished - time); - activator.invincible_finished = max(0, activator.invincible_finished - time); + e.strength_finished = max(0, e.strength_finished - time); + e.invincible_finished = max(0, e.invincible_finished - time); PREGIVE(e, items); PREGIVE(e, weapons); @@ -1770,19 +1770,19 @@ float GiveItems(entity e, float beginarg, float endarg) POSTGIVE_VALUE_ROT(e, armorvalue, pauserotarmor_finished, cvar("g_balance_pause_armor_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/armor25.wav", string_null); POSTGIVE_VALUE_ROT(e, health, pauserothealth_finished, cvar("g_balance_pause_health_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/megahealth.wav", string_null); - if(activator.strength_finished <= 0) - activator.strength_finished = 0; + if(e.strength_finished <= 0) + e.strength_finished = 0; else - activator.strength_finished += time; - if(activator.invincible_finished <= 0) - activator.invincible_finished = 0; + e.strength_finished += time; + if(e.invincible_finished <= 0) + e.invincible_finished = 0; else - activator.invincible_finished += time; + e.invincible_finished += time; - if not(activator.weapons & W_WeaponBit(activator.switchweapon)) + if not(e.weapons & W_WeaponBit(e.switchweapon)) _switchweapon = TRUE; if(_switchweapon) - W_SwitchWeapon_Force(activator, w_getbestweapon(activator)); + W_SwitchWeapon_Force(e, w_getbestweapon(e)); return got; } -- 2.39.2