- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.) SVN r899 (trunk)
This commit is contained in:
parent
a390ea6a61
commit
3f497fe8e5
24 changed files with 173 additions and 154 deletions
|
|
@ -349,11 +349,13 @@ bool AActor::SuggestMissileAttack (fixed_t dist)
|
|||
|
||||
bool P_HitFriend(AActor * self)
|
||||
{
|
||||
AActor *linetarget;
|
||||
|
||||
if (self->flags&MF_FRIENDLY && self->target != NULL)
|
||||
{
|
||||
angle_t angle = R_PointToAngle2 (self->x, self->y, self->target->x, self->target->y);
|
||||
fixed_t dist = P_AproxDistance (self->x-self->target->x, self->y-self->target->y);
|
||||
P_AimLineAttack (self, angle, dist, 0, true);
|
||||
P_AimLineAttack (self, angle, dist, &linetarget, 0, true);
|
||||
if (linetarget != NULL && linetarget != self->target)
|
||||
{
|
||||
return self->IsFriend (linetarget);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue