From 4472d52c145d0315144d833a7ce408bb1de52fa0 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 29 Sep 2016 11:59:10 +1000 Subject: [PATCH] Fix weaplast --- qcsrc/server/client.qc | 3 +-- qcsrc/server/g_damage.qc | 2 +- qcsrc/server/miscfunctions.qc | 2 +- qcsrc/server/weapons/selection.qc | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index b3e87e03b..ccb658e73 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -701,10 +701,9 @@ void PutClientInServer(entity this) this.(weaponentity).m_switchweapon = WEP_Null; this.(weaponentity).weaponname = ""; this.(weaponentity).m_switchingweapon = WEP_Null; + this.cnt = -1; } - this.cnt = -1; // TODO - if (!warmup_stage && !this.alivetime) this.alivetime = time; diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 7a28ae733..6851f7cdf 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -123,7 +123,7 @@ string AppendItemcodes(string s, entity player) //if(w == 0) // w = player.switchweapon; if(w == 0) - w = player.cnt; // previous weapon! + w = player.(weaponentity).cnt; // previous weapon! s = strcat(s, ftos(w)); if(time < player.strength_finished) s = strcat(s, "S"); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 00e33f0c4..d38eedaf3 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -271,7 +271,7 @@ string formatmessage(entity this, string msg) case "l": replacement = NearestLocation(this.origin); break; case "y": replacement = NearestLocation(cursor); break; case "d": replacement = NearestLocation(this.death_origin); break; - case "w": replacement = ((this.(weaponentity).m_weapon == WEP_Null) ? ((this.(weaponentity).m_switchweapon == WEP_Null) ? Weapons_from(this.cnt) : this.(weaponentity).m_switchweapon) : this.(weaponentity).m_weapon).m_name; break; + case "w": replacement = ((this.(weaponentity).m_weapon == WEP_Null) ? ((this.(weaponentity).m_switchweapon == WEP_Null) ? Weapons_from(this.(weaponentity).cnt) : this.(weaponentity).m_switchweapon) : this.(weaponentity).m_weapon).m_name; break; case "W": replacement = ammoitems; break; case "x": replacement = ((cursor_ent.netname == "" || !cursor_ent) ? "nothing" : cursor_ent.netname); break; case "s": replacement = ftos(vlen(this.velocity - this.velocity_z * '0 0 1')); break; diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index da6631094..809becc33 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -316,7 +316,7 @@ void W_PreviousWeapon(entity this, float list, .entity weaponentity) // previously used if exists and has ammo, (second) best otherwise void W_LastWeapon(entity this, .entity weaponentity) { - Weapon wep = Weapons_from(this.cnt); + Weapon wep = Weapons_from(this.(weaponentity).cnt); if (client_hasweapon(this, wep, true, false)) W_SwitchWeapon(this, wep, weaponentity); else -- 2.39.2