NSEntity: Fix for IsVisible(entity), where we wouldn't 'see' the target correctly, as the trace collides with them and isn't returning a fraction of 1.0.
This commit is contained in:
parent
ae23af60d8
commit
73c762e875
1 changed files with 5 additions and 2 deletions
|
@ -124,15 +124,18 @@ NSEntity::Visible(entity ent)
|
|||
float flFoV;
|
||||
|
||||
makevectors(angles);
|
||||
flDelta = normalize (ent.origin - origin);
|
||||
flDelta = normalize(ent.origin - origin);
|
||||
flFoV = flDelta * v_forward;
|
||||
|
||||
/* is it in our field of view? */
|
||||
if (flFoV > 0.3) {
|
||||
traceline(origin, ent.origin, MOVE_NORMAL, this);
|
||||
if (trace_fraction == 1.0) {
|
||||
if (trace_fraction == 1.0 || trace_ent == ent) {
|
||||
print(sprintf("%s can see %s\n", classname, ent.classname));
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
print(sprintf("%s can not see %s\n", classname, ent.classname));
|
||||
return (false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue