]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Minor optimization: use pointcontents to check if an item is under water instead...
authorMario <mario@smbclan.net>
Sat, 6 May 2017 10:21:44 +0000 (20:21 +1000)
committerMario <mario@smbclan.net>
Sat, 6 May 2017 10:21:44 +0000 (20:21 +1000)
qcsrc/server/bot/default/havocbot/roles.qc

index 2d5075f921a1d34ffa77e7cc1baa6e87704cd9f4..5437c69308e978db12aeceabaa721fb77caf75fe 100644 (file)
@@ -97,8 +97,8 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float
                else
                {
                        // Ignore items under water
-                       traceline(it.origin + it.maxs, it.origin + it.maxs, MOVE_NORMAL, it);
-                       if(trace_dpstartcontents & DPCONTENTS_LIQUIDSMASK)
+                       // TODO: can't .waterlevel be used here?
+                       if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(it.origin + ((it.mins + it.maxs) * 0.5))) & DPCONTENTS_LIQUIDSMASK)
                                continue;
                }