Commit 04cfc7fa authored by terencehill's avatar terencehill

Optimize trigger_hurt check

parent 6a2f0257
Pipeline #5588643 failed with stage
in 13 minutes and 14 seconds
......@@ -766,8 +766,10 @@ void havocbot_movetogoal(entity this)
evadelava = normalize(this.velocity) * -1;
else if (s == CONTENT_SKY)
evadeobstacle = normalize(this.velocity) * -1;
else
else if (tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos))
{
// the traceline check isn't enough but is good as optimization,
// when not true (most of the time) this tracebox call is avoided
tracebox(dst_ahead, this.mins, this.maxs, dst_down, true, this);
if (tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment