]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move weaponorder_byimpulse to ClientState
authorMario <mario@smbclan.net>
Sun, 25 Feb 2018 17:30:53 +0000 (03:30 +1000)
committerMario <mario@smbclan.net>
Sun, 25 Feb 2018 17:30:53 +0000 (03:30 +1000)
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/weapons/selection.qc

index f0837f18017da680fc56745d8919cf99f3017c8e..01f2b74e0b05c756706089065311b90c92d8af64 100644 (file)
@@ -1347,6 +1347,7 @@ void ClientDisconnect(entity this)
     MUTATOR_CALLHOOK(ClientDisconnect, this);
 
        if (CS(this).netname_previous) strunzone(CS(this).netname_previous); // needs to be before the CS entity is removed!
+       if (CS(this).weaponorder_byimpulse) strunzone(CS(this).weaponorder_byimpulse);
        ClientState_detach(this);
 
        Portal_ClearAll(this);
@@ -1367,7 +1368,6 @@ void ClientDisconnect(entity this)
        bot_relinkplayerlist();
 
        if (this.clientstatus) strunzone(this.clientstatus);
-       if (this.weaponorder_byimpulse) strunzone(this.weaponorder_byimpulse);
        if (this.personal) delete(this.personal);
 
        this.playerid = 0;
index 42d7d9560b4e92359242e19428f242d146cbff0a..48d42da0092d2f8cf059d1f2037e8aace3bbc372 100644 (file)
@@ -113,6 +113,7 @@ CLASS(Client, Object)
     ATTRIB(Client, cmd_floodcount, int, this.cmd_floodcount);
     ATTRIB(Client, cmd_floodtime, float, this.cmd_floodtime);
     ATTRIB(Client, wasplayer, bool, this.wasplayer);
+    ATTRIB(Client, weaponorder_byimpulse, string, this.weaponorder_byimpulse);
 
     // networked cvars
 
index 8b4204b126dfa1d1b44306a0abc51222391bc837..ff762e9046fd51d89046dbb196a258d3ef02acec 100644 (file)
@@ -368,12 +368,12 @@ string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(entity this, string wo
 {
        string o;
        o = W_FixWeaponOrder_ForceComplete(wo);
-       if(this.weaponorder_byimpulse)
+       if(CS(this).weaponorder_byimpulse)
        {
-               strunzone(this.weaponorder_byimpulse);
-               this.weaponorder_byimpulse = string_null;
+               strunzone(CS(this).weaponorder_byimpulse);
+               CS(this).weaponorder_byimpulse = string_null;
        }
-       this.weaponorder_byimpulse = strzone(W_FixWeaponOrder_BuildImpulseList(o));
+       CS(this).weaponorder_byimpulse = strzone(W_FixWeaponOrder_BuildImpulseList(o));
        return o;
 }
 
index 693d5a240456323adab1c259b51dfb2551275386..f059dfba9bccd79a97da944a5c9eaea77a98e0be 100644 (file)
@@ -304,7 +304,7 @@ void W_NextWeapon(entity this, int list, .entity weaponentity)
        if(list == 0)
                W_CycleWeapon(this, weaponorder_byid, -1, weaponentity);
        else if(list == 1)
-               W_CycleWeapon(this, this.weaponorder_byimpulse, -1, weaponentity);
+               W_CycleWeapon(this, CS(this).weaponorder_byimpulse, -1, weaponentity);
        else if(list == 2)
                W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, -1, weaponentity);
 }
@@ -315,7 +315,7 @@ void W_PreviousWeapon(entity this, float list, .entity weaponentity)
        if(list == 0)
                W_CycleWeapon(this, weaponorder_byid, +1, weaponentity);
        else if(list == 1)
-               W_CycleWeapon(this, this.weaponorder_byimpulse, +1, weaponentity);
+               W_CycleWeapon(this, CS(this).weaponorder_byimpulse, +1, weaponentity);
        else if(list == 2)
                W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, weaponentity);
 }