mirror of
https://github.com/DrBeef/Raze.git
synced 2025-04-07 00:01:57 +00:00
- FAFcansee refactoring, part 5.
This commit is contained in:
parent
9f9a315ce2
commit
7aca321fab
3 changed files with 7 additions and 16 deletions
|
@ -5034,8 +5034,7 @@ int DoGet(DSWActor* actor)
|
|||
|
||||
auto cstat_bak = actor->spr.cstat;
|
||||
actor->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
can_see = FAFcansee_(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(),
|
||||
pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z, pp->cursector);
|
||||
can_see = FAFcansee(actor->spr.pos, actor->sector(), pp->pos, pp->cursector);
|
||||
actor->spr.cstat = cstat_bak;
|
||||
|
||||
if (!can_see)
|
||||
|
@ -5877,8 +5876,6 @@ void ProcessActiveVars(DSWActor* actor)
|
|||
void AdjustActiveRange(PLAYER* pp, DSWActor* actor, int dist)
|
||||
{
|
||||
DSWActor* plActor = pp->actor;
|
||||
int look_height;
|
||||
|
||||
|
||||
// do no FAFcansee before it is time
|
||||
if (actor->user.wait_active_check < ACTIVE_CHECK_TIME)
|
||||
|
@ -5900,8 +5897,7 @@ void AdjustActiveRange(PLAYER* pp, DSWActor* actor, int dist)
|
|||
//
|
||||
|
||||
// if actor can still see the player
|
||||
look_height = int_ActorZOfTop(actor);
|
||||
if (FAFcansee_(actor->int_pos().X, actor->int_pos().Y, look_height, actor->sector(), plActor->int_pos().X, plActor->int_pos().Y, int_ActorUpperZ(plActor), plActor->sector()))
|
||||
if (FAFcansee(ActorVectOfTop(actor), actor->sector(), ActorUpperVect(plActor), plActor->sector()))
|
||||
{
|
||||
// Player is visible
|
||||
// adjust update range of this sprite
|
||||
|
|
|
@ -2746,8 +2746,7 @@ void DoAutoTurretObject(SECTOR_OBJECT* sop)
|
|||
|
||||
if (sActor->spr.statnum == STAT_SO_SHOOT_POINT)
|
||||
{
|
||||
if (!FAFcansee_(sActor->int_pos().X, sActor->int_pos().Y, sActor->int_pos().Z-Z(4), sActor->sector(),
|
||||
actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y, int_ActorUpperZ(actor->user.targetActor), actor->user.targetActor->sector()))
|
||||
if (!FAFcansee(sActor->spr.pos.plusZ(-4), sActor->sector(), ActorUpperVect(actor->user.targetActor), actor->user.targetActor->sector()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ void ProcessVisOn(void)
|
|||
void VisViewChange(PLAYER* pp, int *vis)
|
||||
{
|
||||
short BrightestVis = NormalVisibility;
|
||||
int x,y,z;
|
||||
DVector3 pos;
|
||||
sectortype* sectp;
|
||||
|
||||
if (paused)
|
||||
|
@ -96,21 +96,17 @@ void VisViewChange(PLAYER* pp, int *vis)
|
|||
auto own = GetOwner(actor);
|
||||
if (own != nullptr)
|
||||
{
|
||||
x = own->int_pos().X;
|
||||
y = own->int_pos().Y;
|
||||
z = own->int_pos().Z;
|
||||
pos = own->spr.pos;
|
||||
sectp = own->sector();
|
||||
}
|
||||
else
|
||||
{
|
||||
x = actor->int_pos().X;
|
||||
y = actor->int_pos().Y;
|
||||
z = actor->int_pos().Z;
|
||||
pos = actor->spr.pos;
|
||||
sectp = actor->sector();
|
||||
}
|
||||
|
||||
// save off the brightest vis that you can see
|
||||
if (FAFcansee_(pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z, pp->cursector, x, y, z, sectp))
|
||||
if (FAFcansee(pp->pos, pp->cursector, pos, sectp))
|
||||
{
|
||||
if (VIS_VisCur(actor) < BrightestVis)
|
||||
BrightestVis = VIS_VisCur(actor);
|
||||
|
|
Loading…
Reference in a new issue