From: Mario Date: Mon, 26 Dec 2016 06:17:49 +0000 (+1000) Subject: Fix crouch checking wrong hook entity X-Git-Tag: xonotic-v0.8.2~326^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b1e5dbb1101a8ab8358e46c09dc063a059c89f74;p=xonotic%2Fxonotic-data.pk3dir.git Fix crouch checking wrong hook entity --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 672ad6f92..a05999d62 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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;