diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index 09cd68710..ed8fbbd60 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -219,7 +219,7 @@ bool CanSeePlayer(DSWActor* actor) // if actor can still see the player 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; else 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); 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; 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); - 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; actor->user.targetActor = itActor; diff --git a/source/games/sw/src/bunny.cpp b/source/games/sw/src/bunny.cpp index 20a2fd111..9e3e71cd2 100644 --- a/source/games/sw/src/bunny.cpp +++ b/source/games/sw/src/bunny.cpp @@ -908,7 +908,7 @@ void DoPickCloseBunny(DSWActor* actor) 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) { diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index e6bb451dc..8c4df54df 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -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, 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); 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); } +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 { int animtype, animindex; diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 850ad1fa7..bc46e5aa7 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1436,7 +1436,7 @@ int PlayerInitFlashBomb(PLAYERp pp) if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK)) 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; damage = GetDamage(itActor, pp->actor, DMG_FLASHBOMB); @@ -1495,7 +1495,7 @@ int InitFlashBomb(DSWActor* actor) if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK)) 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; 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)) 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; 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); diff --git a/source/games/sw/src/miscactr.cpp b/source/games/sw/src/miscactr.cpp index bb16b0bbf..9ef2a709d 100644 --- a/source/games/sw/src/miscactr.cpp +++ b/source/games/sw/src/miscactr.cpp @@ -146,7 +146,7 @@ int DoToiletGirl(DSWActor* actor) bool ICanSee = false; 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) { @@ -199,7 +199,7 @@ int NullToiletGirl(DSWActor* actor) bool ICanSee = false; 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)) KeepActorOnFloor(actor); @@ -366,7 +366,7 @@ int DoWashGirl(DSWActor* actor) bool ICanSee = false; 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) { @@ -428,7 +428,7 @@ int NullWashGirl(DSWActor* actor) bool ICanSee = false; 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)) KeepActorOnFloor(actor); @@ -1154,7 +1154,7 @@ int DoCarGirl(DSWActor* actor) bool ICanSee = false; 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) { @@ -1198,7 +1198,7 @@ int NullCarGirl(DSWActor* actor) bool ICanSee = false; 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)) KeepActorOnFloor(actor); @@ -1354,7 +1354,7 @@ int DoMechanicGirl(DSWActor* actor) bool ICanSee = false; 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) { @@ -1398,7 +1398,7 @@ int NullMechanicGirl(DSWActor* actor) bool ICanSee = false; 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)) KeepActorOnFloor(actor); @@ -1555,7 +1555,7 @@ int DoSailorGirl(DSWActor* actor) bool ICanSee = false; 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) { @@ -1604,7 +1604,7 @@ int NullSailorGirl(DSWActor* actor) static short alreadythrew = 0; 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)) KeepActorOnFloor(actor); @@ -1748,7 +1748,7 @@ int DoPruneGirl(DSWActor* actor) bool ICanSee = false; 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) { @@ -1808,7 +1808,7 @@ int NullPruneGirl(DSWActor* actor) bool ICanSee = false; 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)) KeepActorOnFloor(actor); diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index bba5a7444..c0e563d8e 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1196,9 +1196,9 @@ DSWActor* DoPickTarget(DSWActor* actor, uint32_t max_delta_ang, int skip_targets ezhl = ActorZOfBottom(itActor) - (ActorSizeZ(itActor) >> 2); // 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()) && - !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->spr.pos.X, actor->spr.pos.Y, zh, actor->spr.sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ezhl, itActor->spr.sector()) + if (!FAFcansee(actor, zh, itActor, ezh) && + !FAFcansee(actor, zh, itActor, ezhm) && + !FAFcansee(actor, zh, itActor, ezhl) ) continue; diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 877410a16..b0b831224 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -1148,7 +1148,7 @@ void WeaponExplodeSectorInRange(DSWActor* wActor) if ((unsigned int)dist > (wActor->user.Radius/2) + radius) 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; diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index c9e838970..fe4669e24 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -5920,7 +5920,7 @@ void AdjustActiveRange(PLAYERp pp, DSWActor* actor, int dist) // if actor can still see the player 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 // adjust update range of this sprite diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index a4ca4e756..34df426bc 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -2788,8 +2788,7 @@ void DoAutoTurretObject(SECTOR_OBJECTp sop) 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(), - actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, ActorUpperZ(actor->user.targetActor), actor->user.targetActor->spr.sector())) + if (!FAFcansee(sActor, sActor->spr.pos.Z -Z(4), actor, ActorUpperZ(actor->user.targetActor))) { return; } diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index b0c3e2311..f08abf8ff 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -7036,7 +7036,7 @@ int DoDamageTest(DSWActor* actor) // For speed's sake, try limiting check only to radius weapons! 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; } @@ -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 (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); } @@ -7253,8 +7253,8 @@ int DoExpDamageTest(DSWActor* actor) // Second parameter MUST have blocking bits set or cansee won't work // 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()) && - !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())) + if (!FAFcansee(actor, actor->spr.pos.Z, itActor, ActorUpperZ(actor)) && + !FAFcansee(actor, actor->spr.pos.Z, itActor, ActorLowerZ(actor))) continue; DoDamage(itActor, actor); @@ -7283,7 +7283,7 @@ int DoExpDamageTest(DSWActor* actor) if ((unsigned)dist > actor->user.Radius) 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; if (TEST(itActor->spr.extra, SPRX_BREAKABLE)) @@ -8605,7 +8605,7 @@ int DoMineRangeTest(DSWActor* actor, int range) if (dist > range) 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; return true; @@ -11888,7 +11888,7 @@ int InitSwordAttack(PLAYERp pp) { 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); } } @@ -12064,7 +12064,7 @@ int InitFistAttack(PLAYERp pp) { 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); if (face == 190) { @@ -12348,7 +12348,7 @@ int InitSumoStompAttack(DSWActor* actor) 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); } } @@ -12374,7 +12374,7 @@ int InitMiniSumoClap(DSWActor* actor) { 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); DoDamage(targetActor, actor); @@ -12383,7 +12383,7 @@ int InitMiniSumoClap(DSWActor* actor) } 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); SpawnFireballFlames(actor, targetActor); @@ -13991,7 +13991,7 @@ int DoStaticFlamesDamage(DSWActor* actor) DoDamage(itActor, actor); 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); } }