From d25e1a63b92fa3ba8c20f746228d125f6e8434e0 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 6 May 2017 21:15:42 +1000 Subject: [PATCH] Fix unregistering of rockets (player doesn't have lastrocket assigned to them anymore) --- qcsrc/common/weapons/weapon/devastator.qc | 12 ++++-------- qcsrc/server/bot/default/havocbot/roles.qc | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index ab86be4f8..f22f0cedc 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -76,15 +76,11 @@ spawnfunc(weapon_rocketlauncher) { spawnfunc_weapon_devastator(this); } void W_Devastator_Unregister(entity this) { - if(this.realowner && this.realowner.lastrocket == this) + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { - for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) - { - .entity weaponentity = weaponentities[slot]; - if(this.realowner.(weaponentity).lastrocket == this) - this.realowner.(weaponentity).lastrocket = NULL; - } - // this.realowner.rl_release = 1; + .entity weaponentity = weaponentities[slot]; + if(this.realowner.(weaponentity).lastrocket == this) + this.realowner.(weaponentity).lastrocket = NULL; } } diff --git a/qcsrc/server/bot/default/havocbot/roles.qc b/qcsrc/server/bot/default/havocbot/roles.qc index 768d68037..675dd036b 100644 --- a/qcsrc/server/bot/default/havocbot/roles.qc +++ b/qcsrc/server/bot/default/havocbot/roles.qc @@ -85,8 +85,7 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float continue; traceline(o, o + '0 0 -1500', true, NULL); - float d = pointcontents(trace_endpos + '0 0 1'); - if(d == CONTENT_WATER || d == CONTENT_SLIME || d == CONTENT_LAVA) + if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(trace_endpos + '0 0 1')) & DPCONTENTS_LIQUIDSMASK) continue; // this tracebox_hits_trigger_hurt call isn't needed: // dropped weapons are removed as soon as they fall on a trigger_hurt -- 2.39.2