From ba693a3a194bd699868458482fe63ab89216353f Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 6 May 2017 20:21:44 +1000 Subject: [PATCH] Minor optimization: use pointcontents to check if an item is under water instead of a full traceline --- qcsrc/server/bot/default/havocbot/roles.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/bot/default/havocbot/roles.qc b/qcsrc/server/bot/default/havocbot/roles.qc index 2d5075f92..5437c6930 100644 --- a/qcsrc/server/bot/default/havocbot/roles.qc +++ b/qcsrc/server/bot/default/havocbot/roles.qc @@ -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; } -- 2.39.2