]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/havocbot/roles.qc
Merge branch 'master' into terencehill/bot_waypoints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / havocbot / roles.qc
index 22f444fd1987db19155a730614ddfac21673abc3..6d0b3c6a1cae803294d4adb588868ab6da8dba94 100644 (file)
@@ -1,5 +1,8 @@
 #include "roles.qh"
 
+#include <server/defs.qh>
+#include <server/miscfunctions.qh>
+#include <server/items.qh>
 #include "havocbot.qh"
 
 #include "../cvars.qh"
@@ -79,14 +82,15 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float
                        continue;
 
                // Check if the item can be picked up safely
-               if(it.classname == "droppedweapon")
+               if(Item_IsLoot(it))
                {
                        if(!IS_ONGROUND(it))
                                continue;
                        traceline(o, o + '0 0 -1500', true, NULL);
 
-                       if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(trace_endpos + '0 0 1')) & DPCONTENTS_LIQUIDSMASK)
+                       if(IN_LAVA(trace_endpos + '0 0 1'))
                                continue;
+
                        // this tracebox_hits_trigger_hurt call isn't needed:
                        // dropped weapons are removed as soon as they fall on a trigger_hurt
                        // and can't be rated while they are in the air
@@ -95,9 +99,7 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float
                }
                else
                {
-                       // Ignore items under water
-                       // TODO: can't .waterlevel be used here?
-                       if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(it.origin + ((it.mins + it.maxs) * 0.5))) & DPCONTENTS_LIQUIDSMASK)
+                       if(IN_LAVA(it.origin + (it.mins + it.maxs) * 0.5))
                                continue;
                }