- added two FAFcansee variants that take shorter parameter lists for clearer code.

This commit is contained in:
Christoph Oelckers 2021-12-26 10:47:02 +01:00
parent e3ce0da111
commit 29da39dda0
10 changed files with 54 additions and 38 deletions

View file

@ -219,7 +219,7 @@ bool CanSeePlayer(DSWActor* actor)
// if actor can still see the player // if actor can still see the player
int look_height = ActorZOfTop(actor); int look_height = ActorZOfTop(actor);
if (actor->user.targetActor && FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, look_height, actor->spr.sector(), actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, ActorUpperZ(actor->user.targetActor), actor->user.targetActor->spr.sector())) if (actor->user.targetActor && FAFcansee(actor, look_height, actor->user.targetActor, ActorUpperZ(actor->user.targetActor)))
return true; return true;
else else
return false; return false;
@ -359,7 +359,7 @@ int DoActorPickClosePlayer(DSWActor* actor)
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y, dist, a, b, c); DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y, dist, a, b, c);
DSWActor* plActor = pp->actor; DSWActor* plActor = pp->actor;
if (dist < near_dist && FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, look_height, actor->spr.sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorUpperZ(plActor), plActor->spr.sector())) if (dist < near_dist && FAFcansee(actor, look_height, plActor, ActorUpperZ(plActor)))
{ {
near_dist = dist; near_dist = dist;
actor->user.targetActor = pp->actor; actor->user.targetActor = pp->actor;
@ -385,7 +385,7 @@ TARGETACTOR:
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y, dist, a, b, c); DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y, dist, a, b, c);
if (dist < near_dist && FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, look_height, actor->spr.sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ActorUpperZ(itActor), itActor->spr.sector())) if (dist < near_dist && FAFcansee(actor, look_height, itActor, ActorUpperZ(itActor)))
{ {
near_dist = dist; near_dist = dist;
actor->user.targetActor = itActor; actor->user.targetActor = itActor;

View file

@ -908,7 +908,7 @@ void DoPickCloseBunny(DSWActor* actor)
if (dist > near_dist) continue; if (dist > near_dist) continue;
ICanSee = FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, look_height, actor->spr.sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ActorUpperZ(itActor), itActor->spr.sector()); ICanSee = FAFcansee(actor, look_height, itActor, ActorUpperZ(itActor));
if (ICanSee && dist < near_dist && itActor->user.ID == BUNNY_RUN_R0) if (ICanSee && dist < near_dist && itActor->user.ID == BUNNY_RUN_R0)
{ {

View file

@ -1731,6 +1731,8 @@ void FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect,
int32_t xvect, int32_t yvect, int32_t zvect, int32_t xvect, int32_t yvect, int32_t zvect,
HitInfo& hit, int32_t clipmask); HitInfo& hit, int32_t clipmask);
bool FAFcansee(int32_t xs, int32_t ys, int32_t zs, sectortype* sects, int32_t xe, int32_t ye, int32_t ze, sectortype* secte); bool FAFcansee(int32_t xs, int32_t ys, int32_t zs, sectortype* sects, int32_t xe, int32_t ye, int32_t ze, sectortype* secte);
void FAFgetzrange(vec3_t pos, sectortype* sect, void FAFgetzrange(vec3_t pos, sectortype* sect,
@ -2154,6 +2156,21 @@ inline void PlaySound(int num, DSWActor* actor, Voc3D_Flags flags, int channel =
_PlaySound(num, actor, nullptr, nullptr, flags, channel, sndflags); _PlaySound(num, actor, nullptr, nullptr, flags, channel, sndflags);
} }
inline bool FAFcansee(DSWActor* source, DSWActor* dest)
{
return FAFcansee(source->spr.pos.X, source->spr.pos.Y, source->spr.pos.Z, source->sector(), dest->spr.pos.X, dest->spr.pos.Y, dest->spr.pos.Z, dest->sector());
}
inline bool FAFcansee(DSWActor* source, int srcz, DSWActor* dest, int destz)
{
return FAFcansee(source->spr.pos.X, source->spr.pos.Y, srcz, source->sector(), dest->spr.pos.X, dest->spr.pos.Y, destz, dest->sector());
}
inline bool FAFcanseeOfs(DSWActor* source, int srcz, DSWActor* dest, int destz)
{
return FAFcansee(source->spr.pos.X, source->spr.pos.Y, source->spr.pos.Z + srcz, source->sector(), dest->spr.pos.X, dest->spr.pos.Y, dest->spr.pos.Z + destz, dest->sector());
}
struct ANIMstruct struct ANIMstruct
{ {
int animtype, animindex; int animtype, animindex;

View file

@ -1436,7 +1436,7 @@ int PlayerInitFlashBomb(PLAYERp pp)
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK)) if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK))
continue; continue;
if (!FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - ActorSizeZ(actor), actor->spr.sector())) if (!FAFcanseeOfs(itActor, 0, actor, - ActorSizeZ(actor)))
continue; continue;
damage = GetDamage(itActor, pp->actor, DMG_FLASHBOMB); damage = GetDamage(itActor, pp->actor, DMG_FLASHBOMB);
@ -1495,7 +1495,7 @@ int InitFlashBomb(DSWActor* actor)
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK)) if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK))
continue; continue;
if (!FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - ActorSizeZ(actor), actor->spr.sector())) if (!FAFcanseeOfs(itActor, 0, actor, -ActorSizeZ(actor)))
continue; continue;
damage = GetDamage(itActor, actor, DMG_FLASHBOMB); damage = GetDamage(itActor, actor, DMG_FLASHBOMB);
@ -1897,7 +1897,7 @@ DSWActor* DoFlagRangeTest(DSWActor* actor, int range)
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY)) if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
continue; continue;
if (!FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.sector())) if (!FAFcansee(itActor, actor))
continue; continue;
dist = FindDistance3D(actor->spr.pos.X - itActor->spr.pos.X, actor->spr.pos.Y - itActor->spr.pos.Y, actor->spr.pos.Z - itActor->spr.pos.Z); dist = FindDistance3D(actor->spr.pos.X - itActor->spr.pos.X, actor->spr.pos.Y - itActor->spr.pos.Y, actor->spr.pos.Z - itActor->spr.pos.Z);

View file

@ -146,7 +146,7 @@ int DoToiletGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (actor->user.FlagOwner != 1) if (actor->user.FlagOwner != 1)
{ {
@ -199,7 +199,7 @@ int NullToiletGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (!TEST(actor->user.Flags,SPR_CLIMBING)) if (!TEST(actor->user.Flags,SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -366,7 +366,7 @@ int DoWashGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (RandomRange(1000) > 980 && actor->user.ShellNum <= 0) if (RandomRange(1000) > 980 && actor->user.ShellNum <= 0)
{ {
@ -428,7 +428,7 @@ int NullWashGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (!TEST(actor->user.Flags,SPR_CLIMBING)) if (!TEST(actor->user.Flags,SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -1154,7 +1154,7 @@ int DoCarGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (actor->user.FlagOwner == 1) if (actor->user.FlagOwner == 1)
{ {
@ -1198,7 +1198,7 @@ int NullCarGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (!TEST(actor->user.Flags,SPR_CLIMBING)) if (!TEST(actor->user.Flags,SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -1354,7 +1354,7 @@ int DoMechanicGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (actor->user.FlagOwner == 1) if (actor->user.FlagOwner == 1)
{ {
@ -1398,7 +1398,7 @@ int NullMechanicGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (!TEST(actor->user.Flags,SPR_CLIMBING)) if (!TEST(actor->user.Flags,SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -1555,7 +1555,7 @@ int DoSailorGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (actor->user.FlagOwner == 1) if (actor->user.FlagOwner == 1)
{ {
@ -1604,7 +1604,7 @@ int NullSailorGirl(DSWActor* actor)
static short alreadythrew = 0; static short alreadythrew = 0;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (!TEST(actor->user.Flags,SPR_CLIMBING)) if (!TEST(actor->user.Flags,SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -1748,7 +1748,7 @@ int DoPruneGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (actor->user.FlagOwner == 1) if (actor->user.FlagOwner == 1)
{ {
@ -1808,7 +1808,7 @@ int NullPruneGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->spr.sector()); ICanSee = FAFcansee(actor, ActorZOfMiddle(actor), actor->user.targetActor, ActorZOfMiddle(actor->user.targetActor));
if (!TEST(actor->user.Flags,SPR_CLIMBING)) if (!TEST(actor->user.Flags,SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);

View file

@ -1196,9 +1196,9 @@ DSWActor* DoPickTarget(DSWActor* actor, uint32_t max_delta_ang, int skip_targets
ezhl = ActorZOfBottom(itActor) - (ActorSizeZ(itActor) >> 2); ezhl = ActorZOfBottom(itActor) - (ActorSizeZ(itActor) >> 2);
// If you can't see 'em you can't shoot 'em // If you can't see 'em you can't shoot 'em
if (!FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, zh, actor->spr.sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ezh, itActor->spr.sector()) && if (!FAFcansee(actor, zh, itActor, ezh) &&
!FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, zh, actor->spr.sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ezhm, itActor->spr.sector()) && !FAFcansee(actor, zh, itActor, ezhm) &&
!FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, zh, actor->spr.sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ezhl, itActor->spr.sector()) !FAFcansee(actor, zh, itActor, ezhl)
) )
continue; continue;

View file

@ -1148,7 +1148,7 @@ void WeaponExplodeSectorInRange(DSWActor* wActor)
if ((unsigned int)dist > (wActor->user.Radius/2) + radius) if ((unsigned int)dist > (wActor->user.Radius/2) + radius)
continue; continue;
if (!FAFcansee(wActor->spr.pos.X,wActor->spr.pos.Y,wActor->spr.pos.Z,wActor->spr.sector(),actor->spr.pos.X,actor->spr.pos.Y,actor->spr.pos.Z,actor->spr.sector())) if (!FAFcansee(wActor, actor))
continue; continue;

View file

@ -5920,7 +5920,7 @@ void AdjustActiveRange(PLAYERp pp, DSWActor* actor, int dist)
// if actor can still see the player // if actor can still see the player
look_height = ActorZOfTop(actor); look_height = ActorZOfTop(actor);
if (FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, look_height, actor->spr.sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorUpperZ(plActor), plActor->spr.sector())) if (FAFcansee(actor, look_height, plActor, ActorUpperZ(plActor)))
{ {
// Player is visible // Player is visible
// adjust update range of this sprite // adjust update range of this sprite

View file

@ -2788,8 +2788,7 @@ void DoAutoTurretObject(SECTOR_OBJECTp sop)
if (sActor->spr.statnum == STAT_SO_SHOOT_POINT) if (sActor->spr.statnum == STAT_SO_SHOOT_POINT)
{ {
if (!FAFcansee(sActor->spr.pos.X, sActor->spr.pos.Y, sActor->spr.pos.Z-Z(4), sActor->spr.sector(), if (!FAFcansee(sActor, sActor->spr.pos.Z -Z(4), actor, ActorUpperZ(actor->user.targetActor)))
actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, ActorUpperZ(actor->user.targetActor), actor->user.targetActor->spr.sector()))
{ {
return; return;
} }

View file

@ -7036,7 +7036,7 @@ int DoDamageTest(DSWActor* actor)
// For speed's sake, try limiting check only to radius weapons! // For speed's sake, try limiting check only to radius weapons!
if (actor->user.Radius > 200) if (actor->user.Radius > 200)
{ {
if (!FAFcansee(itActor->spr.pos.X,itActor->spr.pos.Y, ActorUpperZ(actor), itActor->spr.sector(),actor->spr.pos.X,actor->spr.pos.Y,actor->spr.pos.Z,actor->spr.sector())) if (!FAFcansee(itActor, ActorUpperZ(actor), actor actor->spr.pos.Z))
continue; continue;
} }
@ -7109,7 +7109,7 @@ int DoFlamesDamageTest(DSWActor* actor)
if (actor->user.Radius > 200) // Note: No weaps have bigger radius than 200 cept explosion stuff if (actor->user.Radius > 200) // Note: No weaps have bigger radius than 200 cept explosion stuff
{ {
if (FAFcansee(itActor->spr.pos.X,itActor->spr.pos.Y,ActorZOfMiddle(actor),itActor->spr.sector(),actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector())) if (FAFcansee(itActor, ActorZOfMiddle(actor), actor, ActorZOfMiddle(actor)))
{ {
DoDamage(itActor, actor); DoDamage(itActor, actor);
} }
@ -7253,8 +7253,8 @@ int DoExpDamageTest(DSWActor* actor)
// Second parameter MUST have blocking bits set or cansee won't work // Second parameter MUST have blocking bits set or cansee won't work
// added second check for FAF water - hitscans were hitting ceiling // added second check for FAF water - hitscans were hitting ceiling
if (!FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ActorUpperZ(actor), itActor->spr.sector()) && if (!FAFcansee(actor, actor->spr.pos.Z, itActor, ActorUpperZ(actor)) &&
!FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ActorLowerZ(actor), itActor->spr.sector())) !FAFcansee(actor, actor->spr.pos.Z, itActor, ActorLowerZ(actor)))
continue; continue;
DoDamage(itActor, actor); DoDamage(itActor, actor);
@ -7283,7 +7283,7 @@ int DoExpDamageTest(DSWActor* actor)
if ((unsigned)dist > actor->user.Radius) if ((unsigned)dist > actor->user.Radius)
continue; continue;
if (!FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, ActorZOfMiddle(itActor), itActor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.sector())) if (FAFcansee(itActor, ActorZOfMiddle(itActor), actor, actor->spr.pos.Z))
continue; continue;
if (TEST(itActor->spr.extra, SPRX_BREAKABLE)) if (TEST(itActor->spr.extra, SPRX_BREAKABLE))
@ -8605,7 +8605,7 @@ int DoMineRangeTest(DSWActor* actor, int range)
if (dist > range) if (dist > range)
continue; continue;
if (!FAFcansee(itActor->spr.pos.X,itActor->spr.pos.Y,ActorUpperZ(actor),itActor->spr.sector(),actor->spr.pos.X,actor->spr.pos.Y,actor->spr.pos.Z,actor->spr.sector())) if (FAFcansee(itActor, ActorUpperZ(itActor), actor, actor->spr.pos.Z))
continue; continue;
return true; return true;
@ -11888,7 +11888,7 @@ int InitSwordAttack(PLAYERp pp)
{ {
if (SpriteOverlapZ(pp->actor, itActor, Z(20))) if (SpriteOverlapZ(pp->actor, itActor, Z(20)))
{ {
if (FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, ActorZOfMiddle(itActor), itActor->spr.sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorZOfMiddle(plActor), plActor->spr.sector())) if (FAFcansee(itActor, ActorZOfMiddle(itActor), plActor, ActorZOfMiddle(plActor)))
DoDamage(itActor, pp->actor); DoDamage(itActor, pp->actor);
} }
} }
@ -12064,7 +12064,7 @@ int InitFistAttack(PLAYERp pp)
{ {
if (SpriteOverlapZ(pp->actor, itActor, Z(20)) || face == 190) if (SpriteOverlapZ(pp->actor, itActor, Z(20)) || face == 190)
{ {
if (FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, ActorZOfMiddle(itActor), itActor->spr.sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorZOfMiddle(plActor), plActor->spr.sector())) if (FAFcansee(itActor, ActorZOfMiddle(itActor), plActor, ActorZOfMiddle(plActor)))
DoDamage(itActor, plActor); DoDamage(itActor, plActor);
if (face == 190) if (face == 190)
{ {
@ -12348,7 +12348,7 @@ int InitSumoStompAttack(DSWActor* actor)
if (dist < CloseRangeDist(itActor, actor, reach)) if (dist < CloseRangeDist(itActor, actor, reach))
{ {
if (FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, ActorZOfMiddle(itActor), itActor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor), actor->spr.sector())) if (FAFcansee(itActor, ActorZOfMiddle(itActor), actor, ActorZOfMiddle(actor)))
DoDamage(itActor, actor); DoDamage(itActor, actor);
} }
} }
@ -12374,7 +12374,7 @@ int InitMiniSumoClap(DSWActor* actor)
{ {
if (SpriteOverlapZ(actor, targetActor, Z(20))) if (SpriteOverlapZ(actor, targetActor, Z(20)))
{ {
if (FAFcansee(targetActor->spr.pos.X, targetActor->spr.pos.Y, ActorZOfMiddle(targetActor), targetActor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor), actor->spr.sector())) if (FAFcansee(targetActor, ActorZOfMiddle(targetActor), actor, ActorZOfMiddle(actor)))
{ {
PlaySound(DIGI_CGTHIGHBONE, actor, v3df_follow | v3df_dontpan); PlaySound(DIGI_CGTHIGHBONE, actor, v3df_follow | v3df_dontpan);
DoDamage(targetActor, actor); DoDamage(targetActor, actor);
@ -12383,7 +12383,7 @@ int InitMiniSumoClap(DSWActor* actor)
} }
else if (dist < CloseRangeDist(targetActor, actor, reach)) else if (dist < CloseRangeDist(targetActor, actor, reach))
{ {
if (FAFcansee(targetActor->spr.pos.X, targetActor->spr.pos.Y, ActorZOfMiddle(targetActor), targetActor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor), actor->spr.sector())) if (FAFcansee(targetActor, ActorZOfMiddle(targetActor), actor, ActorZOfMiddle(actor)))
{ {
PlaySound(DIGI_30MMEXPLODE, actor, v3df_none); PlaySound(DIGI_30MMEXPLODE, actor, v3df_none);
SpawnFireballFlames(actor, targetActor); SpawnFireballFlames(actor, targetActor);
@ -13991,7 +13991,7 @@ int DoStaticFlamesDamage(DSWActor* actor)
DoDamage(itActor, actor); DoDamage(itActor, actor);
else if (actor->user.Radius > 200) else if (actor->user.Radius > 200)
{ {
if (FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfMiddle(actor),actor->spr.sector(),itActor->spr.pos.X,itActor->spr.pos.Y,ActorZOfMiddle(itActor),itActor->spr.sector())) if (FAFcansee(actor, ActorZOfMiddle(actor), itActor, ActorZOfMiddle(itActor)))
DoDamage(itActor, actor); DoDamage(itActor, actor);
} }
} }