]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix weaplast
authorMario <mario@smbclan.net>
Thu, 29 Sep 2016 01:59:10 +0000 (11:59 +1000)
committerMario <mario@smbclan.net>
Thu, 29 Sep 2016 01:59:10 +0000 (11:59 +1000)
qcsrc/server/client.qc
qcsrc/server/g_damage.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/weapons/selection.qc

index b3e87e03b985522079ee9295b650b31f8e9c3915..ccb658e737d3a15070165277ebabfb9bb0c0ef99 100644 (file)
@@ -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;
 
index 7a28ae7333a10e7699e63cd35d3a7cd0a7e4869e..6851f7cdfe3bb78af48a2a31dfe467aee8729528 100644 (file)
@@ -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");
index 00e33f0c4f14d27965a89156e3f34bc89bb0f1da..d38eedaf3412010935be0cdbb5a09528ed28d081 100644 (file)
@@ -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;
index da663109444111c49fbf3fcf5637f37ace75d3cf..809becc33ff8cc115788dc6f3f7c43af64dad248 100644 (file)
@@ -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