]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make sure auxiliary crosshairs are reset when observing/respawning
authorMario <mario@smbclan.net>
Thu, 8 Feb 2018 05:10:46 +0000 (15:10 +1000)
committerMario <mario@smbclan.net>
Thu, 8 Feb 2018 05:10:46 +0000 (15:10 +1000)
qcsrc/server/client.qc

index 16908fcd3c90b740098d6c62c286f516ec099a7a..749e59f142f8c5105523fefbd4e3dad850638ab0 100644 (file)
@@ -357,6 +357,14 @@ void PutObserverInServer(entity this)
 
        //this.spawnpoint_targ = NULL; // keep it so they can return to where they were?
 
+       for(int slot = 0; slot < MAX_AXH; ++slot)
+       {
+               entity axh = this.(AuxiliaryXhair[slot]);
+               this.(AuxiliaryXhair[slot]) = NULL;
+               if(axh && axh.owner == this)
+                       delete(axh);
+       }
+
        this.weaponmodel = "";
        for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
        {
@@ -643,6 +651,14 @@ void PutPlayerInServer(entity this)
 
        this.spawnpoint_targ = NULL;
 
+       for(int slot = 0; slot < MAX_AXH; ++slot)
+       {
+               entity axh = this.(AuxiliaryXhair[slot]);
+               this.(AuxiliaryXhair[slot]) = NULL;
+               if(axh && axh.owner == this)
+                       delete(axh);
+       }
+
        this.crouch = false;
        this.view_ofs = STAT(PL_VIEW_OFS, this);
        setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this));