From: Mario Date: Sat, 6 May 2017 10:21:44 +0000 (+1000) Subject: Minor optimization: use pointcontents to check if an item is under water instead... X-Git-Tag: xonotic-v0.8.5~2803 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ba693a3a194bd699868458482fe63ab89216353f;p=xonotic%2Fxonotic-data.pk3dir.git Minor optimization: use pointcontents to check if an item is under water instead of a full traceline --- 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; }