]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix unregistering of rockets (player doesn't have lastrocket assigned to them anymore)
authorMario <mario@smbclan.net>
Sat, 6 May 2017 11:15:42 +0000 (21:15 +1000)
committerMario <mario@smbclan.net>
Sat, 6 May 2017 11:15:42 +0000 (21:15 +1000)
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/server/bot/default/havocbot/roles.qc

index ab86be4f8fee38dbac4285e31af5c33f0b841e4e..f22f0cedc6bc484378d84421f8e8c83342228d18 100644 (file)
@@ -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;
        }
 }
 
index 768d6803773b5dde05022dd5dd14f82c1fa89cc3..675dd036b7e7151dfdf100c98de66b8a242ea0f3 100644 (file)
@@ -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