SERVER: Fix PlayerIsLooking() when inside of bounding box

This commit is contained in:
cypress 2023-12-24 17:34:00 -05:00
parent 965bb03b7c
commit eaabc6b3a8

View file

@ -729,10 +729,17 @@ float(entity them, entity me) PlayerIsLooking =
vector source;
makevectors (them.v_angle);
source = them.origin + them.view_ofs;
traceline (source, source + v_forward*500, 0, them);
if (trace_ent == me)
// Standard 'are we facing' test..
traceline(source, source + v_forward*50, 0, them);
// We're inside of an object.. is it the target?
if (trace_startsolid) {
if (v_forward*normalize(me.origin - them.origin) > 0.7)
ret = true;
} else if (trace_ent == me) {
ret = true;
}
me.solid = old_solid;
setorigin(me, me.origin);