]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix crouch checking wrong hook entity
authorMario <mario@smbclan.net>
Mon, 26 Dec 2016 06:17:49 +0000 (16:17 +1000)
committerMario <mario@smbclan.net>
Mon, 26 Dec 2016 06:17:49 +0000 (16:17 +1000)
qcsrc/server/client.qc

index 672ad6f926715012e9a875e42f74ece88feaa168..a05999d62987692eca018c02c64c2451c13e7e9e 100644 (file)
@@ -2418,8 +2418,18 @@ void PlayerPreThink (entity this)
 
                this.prevorigin = this.origin;
 
+               bool have_hook = false;
+               for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+               {
+                       .entity weaponentity = weaponentities[slot];
+                       if(this.(weaponentity).hook.state)
+                       {
+                               have_hook = true;
+                               break;
+                       }
+               }
                bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this);
-               if (this.hook.state) {
+               if (have_hook) {
                        do_crouch = false;
                } else if (this.waterlevel >= WATERLEVEL_SWIMMING) {
                        do_crouch = false;