X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_weapons.qc;h=34f17a613a7f438f566b6d47859463f50729ac4b;hb=15b437b2e18f0cfada1346d8bb7c29eb68943581;hp=2715d475c8f6b3fa44425d93ac0af5a289b5ad4a;hpb=fc12fff92661d22ac4d9478424c5f8c3f795c6fa;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 2715d475c..34f17a613 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -158,16 +158,6 @@ float weapon_action(float wpn, float wrequest) return (get_weaponinfo(wpn)).weapon_func(wrequest); } -string W_Name(float weaponid) -{ - return (get_weaponinfo(weaponid)).message; -} - -float W_AmmoItemCode(float wpn) -{ - return (get_weaponinfo(wpn)).items & IT_AMMO; -} - .float savenextthink; void thrown_wep_think() { @@ -311,8 +301,6 @@ float W_IsWeaponThrowable(float w) return 0; if (g_weaponarena) return 0; - if (g_lms) - return 0; if (g_cts) return 0; if (g_nexball && w == WEP_GRENADE_LAUNCHER) @@ -357,12 +345,9 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce) W_SwitchWeapon_Force(self, w_getbestweapon(self)); a = W_ThrowNewWeapon(self, w, doreduce, self.origin + delta, velo); - if not(a) - return; - if(a == "") - sprint(self, strcat("You dropped the ^2", W_Name(w), "\n")); - else - sprint(self, strcat("You dropped the ^2", W_Name(w), " with ", a, "\n")); + + if not(a) return; + Send_Notification(NOTIF_ONE, self, MSG_MULTI, ITEM_WEAPON_DROP, a, w); } float forbidWeaponUse() @@ -418,24 +403,25 @@ void W_WeaponFrame() // end switching! self.switchingweapon = self.switchweapon; + entity newwep = get_weaponinfo(self.switchweapon); + //setanim(self, self.anim_draw, FALSE, TRUE, TRUE); self.weaponentity.state = WS_RAISE; weapon_action(self.switchweapon, WR_SETUP); // set our clip load to the load of the weapon we switched to, if it's reloadable - entity e; - e = get_weaponinfo(self.switchweapon); - if(e.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", e.netname, "_reload_ammo"))) // prevent accessing undefined cvars + if(newwep.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", newwep.netname, "_reload_ammo"))) // prevent accessing undefined cvars { self.clip_load = self.(weapon_load[self.switchweapon]); - self.clip_size = cvar(strcat("g_balance_", e.netname, "_reload_ammo")); + self.clip_size = cvar(strcat("g_balance_", newwep.netname, "_reload_ammo")); } else self.clip_load = self.clip_size = 0; // VorteX: add player model weapon select frame here // setcustomframe(PlayerWeaponRaise); - weapon_thinkf(WFRAME_IDLE, autocvar_g_balance_weaponswitchdelay, w_ready); + weapon_thinkf(WFRAME_IDLE, cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)), w_ready); + //print(sprintf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_raise", newwep.netname), cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)))); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0'); } else if (self.weaponentity.state == WS_DROP) @@ -448,6 +434,8 @@ void W_WeaponFrame() // start switching! self.switchingweapon = self.switchweapon; + entity oldwep = get_weaponinfo(self.weapon); + #ifndef INDEPENDENT_ATTACK_FINISHED if(ATTACK_FINISHED(self) <= time + self.weapon_frametime * 0.5) { @@ -455,7 +443,8 @@ void W_WeaponFrame() sound (self, CH_WEAPON_SINGLE, "weapons/weapon_switch.wav", VOL_BASE, ATTN_NORM); self.weaponentity.state = WS_DROP; // set up weapon switch think in the future, and start drop anim - weapon_thinkf(WFRAME_DONTCHANGE, autocvar_g_balance_weaponswitchdelay, w_clear); + weapon_thinkf(WFRAME_DONTCHANGE, cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)), w_clear); + //print(sprintf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_drop", oldwep.netname), cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)))); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE); #ifndef INDEPENDENT_ATTACK_FINISHED }