mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- SW: replaced spr.pos globally (except two functions)
# Conflicts: # source/games/sw/src/_polymost.cpp
This commit is contained in:
parent
d35b131dd5
commit
e732e2f947
37 changed files with 925 additions and 925 deletions
|
@ -211,7 +211,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
|
|||
}
|
||||
actor->user.ActorActionFunc = nullptr;
|
||||
// Get angle to player
|
||||
actor->spr.ang = NORM_ANGLE(getangle(actor->user.targetActor->spr.pos.X - actor->spr.pos.X, actor->user.targetActor->spr.pos.Y - actor->spr.pos.Y) + 1024);
|
||||
actor->spr.ang = NORM_ANGLE(getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y) + 1024);
|
||||
break;
|
||||
|
||||
case UZI_SMOKE+1: // Shotgun
|
||||
|
@ -234,7 +234,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
|
|||
DoActorBeginJump(actor);
|
||||
actor->user.ActorActionFunc = nullptr;
|
||||
// Get angle to player
|
||||
actor->spr.ang = NORM_ANGLE(getangle(actor->user.targetActor->spr.pos.X - actor->spr.pos.X, actor->user.targetActor->spr.pos.Y - actor->spr.pos.Y) + 1024);
|
||||
actor->spr.ang = NORM_ANGLE(getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y) + 1024);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -397,7 +397,7 @@ int DoActorDebris(DSWActor* actor)
|
|||
KillActor(actor);
|
||||
return 0;
|
||||
case ZILLA_RUN_R0:
|
||||
getzsofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.hiz, &actor->user.loz);
|
||||
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &actor->user.hiz, &actor->user.loz);
|
||||
actor->user.lo_sectp = actor->sector();
|
||||
actor->user.hi_sectp = actor->sector();
|
||||
actor->user.lowActor = nullptr;
|
||||
|
@ -476,7 +476,7 @@ int DoGenerateSewerDebris(DSWActor* actor)
|
|||
{
|
||||
actor->user.Tics = actor->user.WaitTics;
|
||||
|
||||
auto spawned = SpawnActor(STAT_DEAD_ACTOR, 0, Debris[RANDOM_P2(4<<8)>>8], actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 200);
|
||||
auto spawned = SpawnActor(STAT_DEAD_ACTOR, 0, Debris[RANDOM_P2(4<<8)>>8], actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, 200);
|
||||
|
||||
SetOwner(actor, spawned);
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ void KeepActorOnFloor(DSWActor* actor)
|
|||
{
|
||||
int ceilz, florz;
|
||||
Collision ctrash, ftrash;
|
||||
FAFgetzrangepoint(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector(),
|
||||
FAFgetzrangepoint(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(),
|
||||
&ceilz, &ctrash, &florz, &ftrash);
|
||||
|
||||
actor->set_int_z(actor->user.oz = florz);
|
||||
|
@ -664,7 +664,7 @@ int DoActorJump(DSWActor* actor)
|
|||
|
||||
// if player gets to close the ceiling while jumping
|
||||
int minh = actor->user.hiz + (tileHeight(actor->spr.picnum) << 8);
|
||||
if (actor->spr.pos.Z < minh)
|
||||
if (actor->int_pos().Z < minh)
|
||||
{
|
||||
// put player at the ceiling
|
||||
actor->set_int_z(minh);
|
||||
|
@ -718,7 +718,7 @@ int DoActorFall(DSWActor* actor)
|
|||
actor->add_int_z(actor->user.jump_speed * ACTORMOVETICS);
|
||||
|
||||
// Stick like glue when you hit the ground
|
||||
if (actor->spr.pos.Z > actor->user.loz)
|
||||
if (actor->int_pos().Z > actor->user.loz)
|
||||
{
|
||||
DoActorStopFall(actor);
|
||||
}
|
||||
|
@ -830,7 +830,7 @@ int DoJump(DSWActor* actor)
|
|||
|
||||
// if player gets to close the ceiling while jumping
|
||||
int minh = actor->user.hiz + (tileHeight(actor->spr.picnum) << 8);
|
||||
if (actor->spr.pos.Z < minh)
|
||||
if (actor->int_pos().Z < minh)
|
||||
{
|
||||
// put player at the ceiling
|
||||
actor->set_int_z(minh);
|
||||
|
@ -867,7 +867,7 @@ int DoFall(DSWActor* actor)
|
|||
actor->add_int_z(actor->user.jump_speed * ACTORMOVETICS);
|
||||
|
||||
// Stick like glue when you hit the ground
|
||||
if (actor->spr.pos.Z > actor->user.loz - actor->user.floor_dist)
|
||||
if (actor->int_pos().Z > actor->user.loz - actor->user.floor_dist)
|
||||
{
|
||||
actor->set_int_z(actor->user.loz - actor->user.floor_dist);
|
||||
actor->user.Flags &= ~(SPR_FALLING);
|
||||
|
|
|
@ -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->sector(), actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, ActorUpperZ(actor->user.targetActor), actor->user.targetActor->sector()))
|
||||
if (actor->user.targetActor && FAFcansee(actor->int_pos().X, actor->int_pos().Y, look_height, actor->sector(), actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y, ActorUpperZ(actor->user.targetActor), actor->user.targetActor->sector()))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
@ -233,28 +233,28 @@ int CanHitPlayer(DSWActor* actor)
|
|||
// if actor can still see the player
|
||||
int zhs, zhh;
|
||||
|
||||
zhs = actor->spr.pos.Z - (ActorSizeZ(actor) >> 1);
|
||||
zhs = actor->int_pos().Z - (ActorSizeZ(actor) >> 1);
|
||||
|
||||
|
||||
auto targ = actor->user.targetActor;
|
||||
|
||||
// get angle to target
|
||||
ang = getangle(targ->spr.pos.X - actor->spr.pos.X, targ->spr.pos.Y - actor->spr.pos.Y);
|
||||
ang = getangle(targ->int_pos().X - actor->int_pos().X, targ->int_pos().Y - actor->int_pos().Y);
|
||||
|
||||
// get x,yvect
|
||||
xvect = bcos(ang);
|
||||
yvect = bsin(ang);
|
||||
|
||||
// get zvect
|
||||
zhh = targ->spr.pos.Z - (ActorSizeZ(targ) >> 1);
|
||||
if (targ->spr.pos.X - actor->spr.pos.X != 0)
|
||||
zvect = xvect * ((zhh - zhs) / (targ->spr.pos.X - actor->spr.pos.X));
|
||||
else if (targ->spr.pos.Y - actor->spr.pos.Y != 0)
|
||||
zvect = yvect * ((zhh - zhs) / (targ->spr.pos.Y - actor->spr.pos.Y));
|
||||
zhh = targ->int_pos().Z - (ActorSizeZ(targ) >> 1);
|
||||
if (targ->int_pos().X - actor->int_pos().X != 0)
|
||||
zvect = xvect * ((zhh - zhs) / (targ->int_pos().X - actor->int_pos().X));
|
||||
else if (targ->int_pos().Y - actor->int_pos().Y != 0)
|
||||
zvect = yvect * ((zhh - zhs) / (targ->int_pos().Y - actor->int_pos().Y));
|
||||
else
|
||||
return false;
|
||||
|
||||
FAFhitscan(actor->spr.pos.X, actor->spr.pos.Y, zhs, actor->sector(),
|
||||
FAFhitscan(actor->int_pos().X, actor->int_pos().Y, zhs, actor->sector(),
|
||||
xvect,
|
||||
yvect,
|
||||
zvect,
|
||||
|
@ -324,7 +324,7 @@ int DoActorPickClosePlayer(DSWActor* actor)
|
|||
// continue;
|
||||
}
|
||||
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y, dist, a, b, c);
|
||||
|
||||
if (dist < near_dist)
|
||||
{
|
||||
|
@ -350,10 +350,10 @@ int DoActorPickClosePlayer(DSWActor* actor)
|
|||
continue;
|
||||
}
|
||||
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_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->sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorUpperZ(plActor), plActor->sector()))
|
||||
if (dist < near_dist && FAFcansee(actor->int_pos().X, actor->int_pos().Y, look_height, actor->sector(), plActor->int_pos().X, plActor->int_pos().Y, ActorUpperZ(plActor), plActor->sector()))
|
||||
{
|
||||
near_dist = dist;
|
||||
actor->user.targetActor = pp->actor;
|
||||
|
@ -377,9 +377,9 @@ TARGETACTOR:
|
|||
if ((itActor->user.Flags & (SPR_SUICIDE | SPR_DEAD)))
|
||||
continue;
|
||||
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, itActor->int_pos().X, itActor->int_pos().Y, dist, a, b, c);
|
||||
|
||||
if (dist < near_dist && FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, look_height, actor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ActorUpperZ(itActor), itActor->sector()))
|
||||
if (dist < near_dist && FAFcansee(actor->int_pos().X, actor->int_pos().Y, look_height, actor->sector(), itActor->int_pos().X, itActor->int_pos().Y, ActorUpperZ(itActor), itActor->sector()))
|
||||
{
|
||||
near_dist = dist;
|
||||
actor->user.targetActor = itActor;
|
||||
|
@ -433,12 +433,12 @@ int DoActorOperate(DSWActor* actor)
|
|||
if ((actor->user.WaitTics -= ACTORMOVETICS) > 0)
|
||||
return false;
|
||||
|
||||
z[0] = actor->spr.pos.Z - ActorSizeZ(actor) + Z(5);
|
||||
z[1] = actor->spr.pos.Z - (ActorSizeZ(actor) >> 1);
|
||||
z[0] = actor->int_pos().Z - ActorSizeZ(actor) + Z(5);
|
||||
z[1] = actor->int_pos().Z - (ActorSizeZ(actor) >> 1);
|
||||
|
||||
for (i = 0; i < SIZ(z); i++)
|
||||
{
|
||||
neartag({ actor->spr.pos.X, actor->spr.pos.Y, z[i] }, actor->sector(), actor->spr.ang, near, 1024, NTAG_SEARCH_LO_HI);
|
||||
neartag({ actor->int_pos().X, actor->int_pos().Y, z[i] }, actor->sector(), actor->spr.ang, near, 1024, NTAG_SEARCH_LO_HI);
|
||||
}
|
||||
|
||||
if (near.hitSector != nullptr && near.hitpos.X < 1024)
|
||||
|
@ -518,7 +518,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
|
|||
DoActorOperate(actor);
|
||||
|
||||
// if far enough away and cannot see the player
|
||||
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y);
|
||||
dist = Distance(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y);
|
||||
|
||||
if (dist > 30000 && !ICanSee)
|
||||
{
|
||||
|
@ -609,7 +609,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
|
|||
DoActorPickClosePlayer(actor);
|
||||
|
||||
// if close by
|
||||
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y);
|
||||
dist = Distance(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y);
|
||||
if (dist < 15000 || ICanSee)
|
||||
{
|
||||
if ((Facing(actor, actor->user.targetActor) && dist < 10000) || ICanSee)
|
||||
|
@ -816,7 +816,7 @@ int DoActorCantMoveCloser(DSWActor* actor)
|
|||
|
||||
if (actor->user.track >= 0)
|
||||
{
|
||||
actor->spr.ang = getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->spr.pos.X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->int_pos().X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->int_pos().Y);
|
||||
|
||||
DoActorSetSpeed(actor, MID_SPEED);
|
||||
actor->user.Flags |= (SPR_FIND_PLAYER);
|
||||
|
@ -867,7 +867,7 @@ int DoActorMoveCloser(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
// turn to face player
|
||||
actor->spr.ang = getangle(actor->user.targetActor->spr.pos.X - actor->spr.pos.X, actor->user.targetActor->spr.pos.Y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -922,7 +922,7 @@ int FindTrackToPlayer(DSWActor* actor)
|
|||
BIT(TT_SCAN)
|
||||
};
|
||||
|
||||
zdiff = ActorUpperZ(actor->user.targetActor) - (actor->spr.pos.Z - ActorSizeZ(actor) + Z(8));
|
||||
zdiff = ActorUpperZ(actor->user.targetActor) - (actor->int_pos().Z - ActorSizeZ(actor) + Z(8));
|
||||
|
||||
if (abs(zdiff) <= Z(20))
|
||||
{
|
||||
|
@ -1048,7 +1048,7 @@ int InitActorRunAway(DSWActor* actor)
|
|||
|
||||
if (actor->user.track >= 0)
|
||||
{
|
||||
actor->spr.ang = NORM_ANGLE(getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->spr.pos.X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->spr.pos.Y));
|
||||
actor->spr.ang = NORM_ANGLE(getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->int_pos().X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->int_pos().Y));
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
actor->user.Flags |= (SPR_RUN_AWAY);
|
||||
}
|
||||
|
@ -1128,7 +1128,7 @@ int InitActorAttack(DSWActor* actor)
|
|||
//NewStateGroup(actor, actor->user.ActorActionSet->Stand);
|
||||
|
||||
// face player when attacking
|
||||
actor->spr.ang = NORM_ANGLE(getangle(actor->user.targetActor->spr.pos.X - actor->spr.pos.X, actor->user.targetActor->spr.pos.Y - actor->spr.pos.Y));
|
||||
actor->spr.ang = NORM_ANGLE(getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y));
|
||||
|
||||
// If it's your own kind, lay off!
|
||||
if (actor->user.ID == actor->user.targetActor->user.ID && !actor->user.targetActor->user.PlayerP)
|
||||
|
@ -1169,7 +1169,7 @@ int DoActorAttack(DSWActor* actor)
|
|||
|
||||
DoActorNoise(ChooseAction(actor->user.Personality->Broadcast),actor);
|
||||
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y, dist, a, b, c);
|
||||
|
||||
auto pActor = GetPlayerSpriteNum(actor);
|
||||
if ((actor->user.ActorActionSet->CloseAttack[0] && dist < CloseRangeDist(actor, actor->user.targetActor)) ||
|
||||
|
@ -1208,7 +1208,7 @@ int InitActorEvade(DSWActor* actor)
|
|||
|
||||
if (actor->user.track >= 0)
|
||||
{
|
||||
actor->spr.ang = NORM_ANGLE(getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->spr.pos.X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->spr.pos.Y));
|
||||
actor->spr.ang = NORM_ANGLE(getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->int_pos().X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->int_pos().Y));
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
// NOT doing a RUN_AWAY
|
||||
actor->user.Flags &= ~(SPR_RUN_AWAY);
|
||||
|
@ -1228,7 +1228,7 @@ int InitActorWanderAround(DSWActor* actor)
|
|||
|
||||
if (actor->user.track >= 0)
|
||||
{
|
||||
actor->spr.ang = getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->spr.pos.X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->int_pos().X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->int_pos().Y);
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
}
|
||||
|
||||
|
@ -1244,7 +1244,7 @@ int InitActorFindPlayer(DSWActor* actor)
|
|||
|
||||
if (actor->user.track >= 0)
|
||||
{
|
||||
actor->spr.ang = getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->spr.pos.X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->int_pos().X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->int_pos().Y);
|
||||
DoActorSetSpeed(actor, MID_SPEED);
|
||||
actor->user.Flags |= (SPR_FIND_PLAYER);
|
||||
|
||||
|
@ -1273,7 +1273,7 @@ int InitActorDuck(DSWActor* actor)
|
|||
actor->user.ActorActionFunc = DoActorDuck;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Duck);
|
||||
|
||||
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y);
|
||||
dist = Distance(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y);
|
||||
|
||||
if (dist > 8000)
|
||||
{
|
||||
|
@ -1338,9 +1338,9 @@ Collision move_scan(DSWActor* actor, int ang, int dist, int *stopx, int *stopy,
|
|||
// moves out a bit but keeps the sprites original postion/sector.
|
||||
|
||||
// save off position info
|
||||
x = actor->spr.pos.X;
|
||||
y = actor->spr.pos.Y;
|
||||
z = actor->spr.pos.Z;
|
||||
x = actor->int_pos().X;
|
||||
y = actor->int_pos().Y;
|
||||
z = actor->int_pos().Z;
|
||||
sang = actor->spr.ang;
|
||||
loz = actor->user.loz;
|
||||
hiz = actor->user.hiz;
|
||||
|
@ -1361,9 +1361,9 @@ Collision move_scan(DSWActor* actor, int ang, int dist, int *stopx, int *stopy,
|
|||
// should I look down with a FAFgetzrange to see where I am?
|
||||
|
||||
// remember where it stopped
|
||||
*stopx = actor->spr.pos.X;
|
||||
*stopy = actor->spr.pos.Y;
|
||||
*stopz = actor->spr.pos.Z;
|
||||
*stopx = actor->int_pos().X;
|
||||
*stopy = actor->int_pos().Y;
|
||||
*stopz = actor->int_pos().Z;
|
||||
|
||||
// reset position information
|
||||
actor->set_int_pos({ x, y, z });
|
||||
|
@ -1419,7 +1419,7 @@ int FindNewAngle(DSWActor* actor, int dir, int DistToMove)
|
|||
DistToMove = (DistToMove >> 2) + (DistToMove >> 3);
|
||||
|
||||
// Find angle to from the player
|
||||
oang = NORM_ANGLE(getangle(actor->user.targetActor->spr.pos.X - actor->spr.pos.X, actor->user.targetActor->spr.pos.Y - actor->spr.pos.Y));
|
||||
oang = NORM_ANGLE(getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y));
|
||||
|
||||
// choose a random angle array
|
||||
switch (dir)
|
||||
|
@ -1468,13 +1468,13 @@ int FindNewAngle(DSWActor* actor, int dir, int DistToMove)
|
|||
if (ret.type == kHitNone)
|
||||
{
|
||||
// cleanly moved in new direction without hitting something
|
||||
actor->user.TargetDist = Distance(actor->spr.pos.X, actor->spr.pos.Y, stopx, stopy);
|
||||
actor->user.TargetDist = Distance(actor->int_pos().X, actor->int_pos().Y, stopx, stopy);
|
||||
return new_ang;
|
||||
}
|
||||
else
|
||||
{
|
||||
// hit something
|
||||
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, stopx, stopy);
|
||||
dist = Distance(actor->int_pos().X, actor->int_pos().Y, stopx, stopy);
|
||||
|
||||
if (dist > save_dist)
|
||||
{
|
||||
|
@ -1563,7 +1563,7 @@ int InitActorReposition(DSWActor* actor)
|
|||
actor->user.Dist = 0;
|
||||
|
||||
rnum = RANDOM_P2(8<<8)>>8;
|
||||
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y);
|
||||
dist = Distance(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y);
|
||||
|
||||
if (dist < PlayerDist[rnum] || (actor->user.Flags & SPR_RUN_AWAY))
|
||||
{
|
||||
|
|
|
@ -832,7 +832,7 @@ int DoBunnyBeginJumpAttack(DSWActor* actor)
|
|||
DSWActor* target = actor->user.targetActor;
|
||||
int tang;
|
||||
|
||||
tang = getangle(target->spr.pos.X - actor->spr.pos.X, target->spr.pos.Y - actor->spr.pos.Y);
|
||||
tang = getangle(target->int_pos().X - actor->int_pos().X, target->int_pos().Y - actor->int_pos().Y);
|
||||
|
||||
Collision coll = move_sprite(actor, bcos(tang, -7), bsin(tang, -7),
|
||||
0L, actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS);
|
||||
|
@ -904,11 +904,11 @@ void DoPickCloseBunny(DSWActor* actor)
|
|||
|
||||
if (itActor->user.ID != BUNNY_RUN_R0) continue;
|
||||
|
||||
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(itActor->int_pos().X, itActor->int_pos().Y, actor->int_pos().X, actor->int_pos().Y, dist, a, b, c);
|
||||
|
||||
if (dist > near_dist) continue;
|
||||
|
||||
ICanSee = FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, look_height, actor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ActorUpperZ(itActor), itActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X, actor->int_pos().Y, look_height, actor->sector(), itActor->int_pos().X, itActor->int_pos().Y, ActorUpperZ(itActor), itActor->sector());
|
||||
|
||||
if (ICanSee && dist < near_dist && itActor->user.ID == BUNNY_RUN_R0)
|
||||
{
|
||||
|
@ -1003,7 +1003,7 @@ int DoBunnyQuickJump(DSWActor* actor)
|
|||
if (pp == Player+myconnectindex)
|
||||
{
|
||||
choose_snd = StdRandomRange(2<<8)>>8;
|
||||
if (FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfTop(actor),actor->sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, actor->user.targetActor))
|
||||
if (FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfTop(actor),actor->sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, actor->user.targetActor))
|
||||
PlayerSound(fagsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp);
|
||||
}
|
||||
}
|
||||
|
@ -1018,13 +1018,13 @@ int DoBunnyQuickJump(DSWActor* actor)
|
|||
if (pp == Player+myconnectindex)
|
||||
{
|
||||
choose_snd = StdRandomRange(3<<8)>>8;
|
||||
if (FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,ActorZOfTop(actor),actor->sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, actor->user.targetActor))
|
||||
if (FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfTop(actor),actor->sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, actor->user.targetActor))
|
||||
PlayerSound(straightsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
actor->set_int_xy(hitActor->spr.pos.X, hitActor->spr.pos.Y);
|
||||
actor->set_int_xy(hitActor->int_pos().X, hitActor->int_pos().Y);
|
||||
actor->spr.ang = hitActor->spr.ang;
|
||||
actor->spr.ang = NORM_ANGLE(actor->spr.ang + 1024);
|
||||
HelpMissileLateral(actor, 2000);
|
||||
|
@ -1084,7 +1084,7 @@ int DoBunnyRipHeart(DSWActor* actor)
|
|||
actor->user.WaitTics = 6 * 120;
|
||||
|
||||
// player face bunny
|
||||
target->spr.ang = getangle(actor->spr.pos.X - target->spr.pos.X, actor->spr.pos.Y - target->spr.pos.Y);
|
||||
target->spr.ang = getangle(actor->int_pos().X - target->int_pos().X, actor->int_pos().Y - target->int_pos().Y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1112,7 +1112,7 @@ void BunnyHatch(DSWActor* actor)
|
|||
for (int i = 0; i < MAX_BUNNYS; i++)
|
||||
{
|
||||
auto actorNew = insertActor(actor->sector(), STAT_DEFAULT);
|
||||
actorNew->set_int_pos(actor->spr.pos);
|
||||
actorNew->set_int_pos(actor->int_pos());
|
||||
actorNew->spr.xrepeat = 30; // Baby size
|
||||
actorNew->spr.yrepeat = 24;
|
||||
actorNew->spr.ang = rip_ang[i];
|
||||
|
@ -1168,7 +1168,7 @@ DSWActor* BunnyHatch2(DSWActor* actor)
|
|||
{
|
||||
|
||||
auto actorNew = insertActor(actor->sector(), STAT_DEFAULT);
|
||||
actorNew->set_int_pos(actor->spr.pos);
|
||||
actorNew->set_int_pos(actor->int_pos());
|
||||
actorNew->spr.xrepeat = 30; // Baby size
|
||||
actorNew->spr.yrepeat = 24;
|
||||
actorNew->spr.ang = RANDOM_P2(2048);
|
||||
|
|
|
@ -505,7 +505,7 @@ void CoolgCommon(DSWActor* actor)
|
|||
actor->user.floor_dist = Z(16);
|
||||
actor->user.ceiling_dist = Z(20);
|
||||
|
||||
actor->user.pos.Z = actor->spr.pos.Z;
|
||||
actor->user.pos.Z = actor->int_pos().Z;
|
||||
|
||||
actor->spr.xrepeat = 42;
|
||||
actor->spr.yrepeat = 42;
|
||||
|
@ -541,7 +541,7 @@ int NewCoolg(DSWActor* actor)
|
|||
{
|
||||
ANIMATOR DoActorDecide;
|
||||
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, COOLG_RUN_R0, &s_CoolgBirth[0], actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 50);
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, COOLG_RUN_R0, &s_CoolgBirth[0], actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, 50);
|
||||
|
||||
ChangeState(actorNew, &s_CoolgBirth[0]);
|
||||
actorNew->user.StateEnd = s_CoolgDie;
|
||||
|
@ -665,7 +665,7 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
|
|||
actor->set_int_z(actor->user.pos.Z + MulScale(COOLG_BOB_AMT, bsin(actor->user.Counter), 14));
|
||||
|
||||
bound = actor->user.hiz + actor->user.ceiling_dist + COOLG_BOB_AMT;
|
||||
if (actor->spr.pos.Z < bound)
|
||||
if (actor->int_pos().Z < bound)
|
||||
{
|
||||
// bumped something
|
||||
actor->set_int_z(actor->user.pos.Z = bound + COOLG_BOB_AMT);
|
||||
|
@ -773,7 +773,7 @@ int DoCoolgDeath(DSWActor* actor)
|
|||
DoFindGroundPoint(actor);
|
||||
|
||||
// on the ground
|
||||
if (actor->spr.pos.Z >= actor->user.loz)
|
||||
if (actor->int_pos().Z >= actor->user.loz)
|
||||
{
|
||||
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); // If upside down, reset it
|
||||
|
|
|
@ -453,10 +453,10 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
|
|||
}
|
||||
}
|
||||
|
||||
if (depth && labs(actor->spr.pos.Z - actor->user.loz) < Z(8))
|
||||
if (depth && labs(actor->int_pos().Z - actor->user.loz) < Z(8))
|
||||
{
|
||||
actor->add_int_z(Z(depth));
|
||||
actor->user.loz = actor->spr.pos.Z;
|
||||
actor->user.loz = actor->int_pos().Z;
|
||||
actor->backupz();
|
||||
}
|
||||
|
||||
|
@ -569,7 +569,7 @@ int DoCoolieMove(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (Distance(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y) < 1200)
|
||||
if (Distance(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y) < 1200)
|
||||
{
|
||||
UpdateSinglePlayKills(actor);
|
||||
DoActorDie(actor, actor, 0);
|
||||
|
|
|
@ -169,8 +169,8 @@ void CopySectorMatch(int match)
|
|||
SectorMidPoint(dActor->sector(), &dx, &dy, &trash);
|
||||
|
||||
// get offset
|
||||
src_xoff = sx - itActor->spr.pos.X;
|
||||
src_yoff = sy - itActor->spr.pos.Y;
|
||||
src_xoff = sx - itActor->int_pos().X;
|
||||
src_yoff = sy - itActor->int_pos().Y;
|
||||
|
||||
// move sprite to dest sector
|
||||
itActor->set_int_xy(dx - src_xoff, dy - src_yoff);
|
||||
|
|
|
@ -456,13 +456,13 @@ void WarpCopySprite(tspriteArray& tsprites)
|
|||
tspritetype* newTSpr = renderAddTsprite(tsprites, itActor2);
|
||||
newTSpr->statnum = 0;
|
||||
|
||||
xoff = itActor->spr.pos.X - newTSpr->pos.X;
|
||||
yoff = itActor->spr.pos.Y - newTSpr->pos.Y;
|
||||
zoff = itActor->spr.pos.Z - newTSpr->pos.Z;
|
||||
xoff = itActor->int_pos().X - newTSpr->pos.X;
|
||||
yoff = itActor->int_pos().Y - newTSpr->pos.Y;
|
||||
zoff = itActor->int_pos().Z - newTSpr->pos.Z;
|
||||
|
||||
newTSpr->pos.X = itActor1->spr.pos.X - xoff;
|
||||
newTSpr->pos.Y = itActor1->spr.pos.Y - yoff;
|
||||
newTSpr->pos.Z = itActor1->spr.pos.Z - zoff;
|
||||
newTSpr->pos.X = itActor1->int_pos().X - xoff;
|
||||
newTSpr->pos.Y = itActor1->int_pos().Y - yoff;
|
||||
newTSpr->pos.Z = itActor1->int_pos().Z - zoff;
|
||||
newTSpr->sectp = itActor1->sector();
|
||||
}
|
||||
|
||||
|
@ -478,8 +478,8 @@ void WarpCopySprite(tspriteArray& tsprites)
|
|||
tspritetype* newTSpr = renderAddTsprite(tsprites, itActor2);
|
||||
newTSpr->statnum = 0;
|
||||
|
||||
auto off = itActor1->spr.pos - newTSpr->pos;
|
||||
newTSpr->pos = itActor->spr.pos - off;
|
||||
auto off = itActor1->int_pos() - newTSpr->pos;
|
||||
newTSpr->pos = itActor->int_pos() - off;
|
||||
newTSpr->sectp = itActor->sector();
|
||||
}
|
||||
}
|
||||
|
@ -639,8 +639,8 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
|
|||
// workaround for mines and floor decals beneath the floor
|
||||
if (tsp->picnum == BETTY_R0 || tsp->picnum == FLOORBLOOD1)
|
||||
{
|
||||
int32_t const floorz = getflorzofslopeptr(tActor->sector(), tActor->spr.pos.X, tActor->spr.pos.Y);
|
||||
if (tActor->spr.pos.Z > floorz)
|
||||
int32_t const floorz = getflorzofslopeptr(tActor->sector(), tActor->int_pos().X, tActor->int_pos().Y);
|
||||
if (tActor->int_pos().Z > floorz)
|
||||
tsp->pos.Z = floorz;
|
||||
}
|
||||
|
||||
|
@ -1066,9 +1066,9 @@ void PrintSpriteInfo(PLAYER* pp)
|
|||
}
|
||||
|
||||
{
|
||||
Printf("POSX:%d, ", actor->spr.pos.X);
|
||||
Printf("POSY:%d, ", actor->spr.pos.Y);
|
||||
Printf("POSZ:%d,", actor->spr.pos.Z);
|
||||
Printf("POSX:%d, ", actor->int_pos().X);
|
||||
Printf("POSY:%d, ", actor->int_pos().Y);
|
||||
Printf("POSZ:%d,", actor->int_pos().Z);
|
||||
Printf("ANG:%d\n", actor->spr.ang);
|
||||
}
|
||||
}
|
||||
|
@ -1096,12 +1096,12 @@ void CameraView(PLAYER* pp, int *tx, int *ty, int *tz, sectortype** tsect, binan
|
|||
SWStatIterator it(STAT_DEMO_CAMERA);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
ang = bvectangbam(*tx - actor->spr.pos.X, *ty - actor->spr.pos.Y);
|
||||
ang = bvectangbam(*tx - actor->int_pos().X, *ty - actor->int_pos().Y);
|
||||
ang_test = getincangle(ang.asbuild(), actor->spr.ang) < actor->spr.lotag;
|
||||
|
||||
FAFcansee_test =
|
||||
(FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector(), *tx, *ty, *tz, pp->cursector) ||
|
||||
FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector(), *tx, *ty, *tz + ActorSizeZ(pp->actor), pp->cursector));
|
||||
(FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), *tx, *ty, *tz, pp->cursector) ||
|
||||
FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), *tx, *ty, *tz + ActorSizeZ(pp->actor), pp->cursector));
|
||||
|
||||
player_in_camera = ang_test && FAFcansee_test;
|
||||
|
||||
|
@ -1134,15 +1134,15 @@ void CameraView(PLAYER* pp, int *tx, int *ty, int *tz, sectortype** tsect, binan
|
|||
xvect = ang.bcos(-3);
|
||||
yvect = ang.bsin(-3);
|
||||
|
||||
zdiff = actor->spr.pos.Z - *tz;
|
||||
if (labs(actor->spr.pos.X - *tx) > 1000)
|
||||
zvect = Scale(xvect, zdiff, actor->spr.pos.X - *tx);
|
||||
else if (labs(actor->spr.pos.Y - *ty) > 1000)
|
||||
zvect = Scale(yvect, zdiff, actor->spr.pos.Y - *ty);
|
||||
else if (actor->spr.pos.X - *tx != 0)
|
||||
zvect = Scale(xvect, zdiff, actor->spr.pos.X - *tx);
|
||||
else if (actor->spr.pos.Y - *ty != 0)
|
||||
zvect = Scale(yvect, zdiff, actor->spr.pos.Y - *ty);
|
||||
zdiff = actor->int_pos().Z - *tz;
|
||||
if (labs(actor->int_pos().X - *tx) > 1000)
|
||||
zvect = Scale(xvect, zdiff, actor->int_pos().X - *tx);
|
||||
else if (labs(actor->int_pos().Y - *ty) > 1000)
|
||||
zvect = Scale(yvect, zdiff, actor->int_pos().Y - *ty);
|
||||
else if (actor->int_pos().X - *tx != 0)
|
||||
zvect = Scale(xvect, zdiff, actor->int_pos().X - *tx);
|
||||
else if (actor->int_pos().Y - *ty != 0)
|
||||
zvect = Scale(yvect, zdiff, actor->int_pos().Y - *ty);
|
||||
else
|
||||
zvect = 0;
|
||||
|
||||
|
@ -1150,9 +1150,9 @@ void CameraView(PLAYER* pp, int *tx, int *ty, int *tz, sectortype** tsect, binan
|
|||
*thoriz = q16horiz(clamp(-(zvect << 8), gi->playerHorizMin(), gi->playerHorizMax()));
|
||||
|
||||
*tang = ang;
|
||||
*tx = actor->spr.pos.X;
|
||||
*ty = actor->spr.pos.Y;
|
||||
*tz = actor->spr.pos.Z;
|
||||
*tx = actor->int_pos().X;
|
||||
*ty = actor->int_pos().Y;
|
||||
*tz = actor->int_pos().Z;
|
||||
*tsect = actor->sector();
|
||||
|
||||
found_camera = true;
|
||||
|
@ -1626,8 +1626,8 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
|
|||
if (actor == peekActor)
|
||||
col = GPalette.BaseColors[31];
|
||||
|
||||
sprx = actor->spr.pos.X;
|
||||
spry = actor->spr.pos.Y;
|
||||
sprx = actor->int_pos().X;
|
||||
spry = actor->int_pos().Y;
|
||||
|
||||
k = actor->spr.statnum;
|
||||
if ((k >= 1) && (k <= 8) && (k != 2)) // Interpolate moving
|
||||
|
|
|
@ -364,7 +364,7 @@ void EelCommon(DSWActor* actor)
|
|||
actor->user.floor_dist = Z(16);
|
||||
actor->user.ceiling_dist = Z(20);
|
||||
|
||||
actor->user.pos.Z = actor->spr.pos.Z;
|
||||
actor->user.pos.Z = actor->int_pos().Z;
|
||||
|
||||
actor->spr.xrepeat = 35;
|
||||
actor->spr.yrepeat = 27;
|
||||
|
@ -462,7 +462,7 @@ int DoEelMatchPlayerZ(DSWActor* actor)
|
|||
// lower bound
|
||||
if (actor->user.lowActor && actor->user.targetActor == actor->user.highActor) // this doesn't look right...
|
||||
{
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.lowActor->spr.pos.X, actor->user.lowActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, actor->user.lowActor->int_pos().X, actor->user.lowActor->int_pos().Y, dist, a, b, c);
|
||||
if (dist <= 300)
|
||||
bound = actor->user.pos.Z;
|
||||
else
|
||||
|
@ -479,7 +479,7 @@ int DoEelMatchPlayerZ(DSWActor* actor)
|
|||
// upper bound
|
||||
if (actor->user.highActor && actor->user.targetActor == actor->user.highActor)
|
||||
{
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.highActor->spr.pos.X, actor->user.highActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, actor->user.highActor->int_pos().X, actor->user.highActor->int_pos().Y, dist, a, b, c);
|
||||
if (dist <= 300)
|
||||
bound = actor->user.pos.Z;
|
||||
else
|
||||
|
@ -500,7 +500,7 @@ int DoEelMatchPlayerZ(DSWActor* actor)
|
|||
actor->set_int_z(actor->user.pos.Z + MulScale(EEL_BOB_AMT, bsin(actor->user.Counter), 14));
|
||||
|
||||
bound = actor->user.hiz + actor->user.ceiling_dist + EEL_BOB_AMT;
|
||||
if (actor->spr.pos.Z < bound)
|
||||
if (actor->int_pos().Z < bound)
|
||||
{
|
||||
// bumped something
|
||||
actor->set_int_z(actor->user.pos.Z = bound + EEL_BOB_AMT);
|
||||
|
@ -534,7 +534,7 @@ int DoEelDeath(DSWActor* actor)
|
|||
DoFindGroundPoint(actor);
|
||||
|
||||
// on the ground
|
||||
if (actor->spr.pos.Z >= actor->user.loz)
|
||||
if (actor->int_pos().Z >= actor->user.loz)
|
||||
{
|
||||
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
|
||||
if (RandomRange(1000) > 500)
|
||||
|
|
|
@ -1954,12 +1954,12 @@ inline bool SectorIsUnderwaterArea(sectortype* sect)
|
|||
|
||||
inline bool PlayerFacingRange(PLAYER* pp, DSWActor* a, int range)
|
||||
{
|
||||
return (abs(getincangle(getangle(a->spr.pos.X - (pp)->pos.X, a->spr.pos.Y - (pp)->pos.Y), (pp)->angle.ang.asbuild())) < (range));
|
||||
return (abs(getincangle(getangle(a->int_pos().X - (pp)->pos.X, a->int_pos().Y - (pp)->pos.Y), (pp)->angle.ang.asbuild())) < (range));
|
||||
}
|
||||
|
||||
inline bool FacingRange(DSWActor* a1, DSWActor* a2, int range)
|
||||
{
|
||||
return (abs(getincangle(getangle(a1->spr.pos.X - a2->spr.pos.X, a1->spr.pos.Y - a2->spr.pos.Y), a2->spr.ang)) < (range));
|
||||
return (abs(getincangle(getangle(a1->int_pos().X - a2->int_pos().X, a1->int_pos().Y - a2->int_pos().Y), a2->spr.ang)) < (range));
|
||||
}
|
||||
inline void SET_BOOL1(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL1; }
|
||||
inline void SET_BOOL2(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL2; }
|
||||
|
@ -2067,7 +2067,7 @@ inline int ActorSizeY(DSWActor* sp)
|
|||
|
||||
inline bool Facing(DSWActor* actor1, DSWActor* actor2)
|
||||
{
|
||||
return (abs(getincangle(getangle(actor1->spr.pos.X - actor2->spr.pos.X, actor1->spr.pos.Y - actor2->spr.pos.Y), actor2->spr.ang)) < 512);
|
||||
return (abs(getincangle(getangle(actor1->int_pos().X - actor2->int_pos().X, actor1->int_pos().Y - actor2->int_pos().Y), actor2->spr.ang)) < 512);
|
||||
}
|
||||
|
||||
// Given a z height and sprite return the correct y repeat value
|
||||
|
|
|
@ -312,7 +312,7 @@ int SetupHornet(DSWActor* actor)
|
|||
actor->user.floor_dist = Z(16);
|
||||
actor->user.ceiling_dist = Z(16);
|
||||
|
||||
actor->user.pos.Z = actor->spr.pos.Z;
|
||||
actor->user.pos.Z = actor->int_pos().Z;
|
||||
|
||||
actor->spr.xrepeat = 37;
|
||||
actor->spr.yrepeat = 32;
|
||||
|
@ -396,7 +396,7 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
|
|||
actor->set_int_z(actor->user.pos.Z + MulScale(HORNET_BOB_AMT, bsin(actor->user.Counter), 14));
|
||||
|
||||
bound = actor->user.hiz + actor->user.ceiling_dist + HORNET_BOB_AMT;
|
||||
if (actor->spr.pos.Z < bound)
|
||||
if (actor->int_pos().Z < bound)
|
||||
{
|
||||
// bumped something
|
||||
actor->set_int_z(actor->user.pos.Z = bound + HORNET_BOB_AMT);
|
||||
|
@ -513,7 +513,7 @@ int DoHornetDeath(DSWActor* actor)
|
|||
actor->user.coll = move_sprite(actor, nx, ny, 0L, actor->user.ceiling_dist, actor->user.floor_dist, 1, ACTORMOVETICS);
|
||||
|
||||
// on the ground
|
||||
if (actor->spr.pos.Z >= actor->user.loz)
|
||||
if (actor->int_pos().Z >= actor->user.loz)
|
||||
{
|
||||
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); // If upside down, reset it
|
||||
|
@ -541,7 +541,7 @@ int DoCheckSwarm(DSWActor* actor)
|
|||
if (actor->user.targetActor->user.PlayerP)
|
||||
{
|
||||
pp = actor->user.targetActor->user.PlayerP;
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y, pdist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y, pdist, a, b, c);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
@ -554,7 +554,7 @@ int DoCheckSwarm(DSWActor* actor)
|
|||
|
||||
if (itActor->spr.hitag != TAG_SWARMSPOT || itActor->spr.lotag != 2) continue;
|
||||
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, itActor->int_pos().X, itActor->int_pos().Y, dist, a, b, c);
|
||||
|
||||
if (dist < pdist && actor->user.ID == itActor->user.ID) // Only flock to your own kind
|
||||
{
|
||||
|
|
|
@ -110,15 +110,15 @@ static double getvalue(so_interp::interp_data& element)
|
|||
return SectorObject[index].pmid.Z;
|
||||
case soi_sprx:
|
||||
if (element.actorofang)
|
||||
return element.actorofang->spr.pos.X;
|
||||
return element.actorofang->int_pos().X;
|
||||
break;
|
||||
case soi_spry:
|
||||
if (element.actorofang)
|
||||
return element.actorofang->spr.pos.Y;
|
||||
return element.actorofang->int_pos().Y;
|
||||
break;
|
||||
case soi_sprz:
|
||||
if (element.actorofang)
|
||||
return element.actorofang->spr.pos.Z;
|
||||
return element.actorofang->int_pos().Z;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -429,8 +429,8 @@ JS_ProcessEchoSpot()
|
|||
{
|
||||
dist = 0x7fffffff;
|
||||
|
||||
j = abs(actor->spr.pos.X - pp->pos.X);
|
||||
j += abs(actor->spr.pos.Y - pp->pos.Y);
|
||||
j = abs(actor->int_pos().X - pp->pos.X);
|
||||
j += abs(actor->int_pos().Y - pp->pos.Y);
|
||||
if (j < dist)
|
||||
dist = j;
|
||||
|
||||
|
@ -509,8 +509,8 @@ void JS_DrawCameras(PLAYER* pp, int tx, int ty, int tz, double smoothratio)
|
|||
{
|
||||
DSWActor* camactor = mirror[cnt].camspriteActor;
|
||||
|
||||
j = abs(camactor->spr.pos.X - tx);
|
||||
j += abs(camactor->spr.pos.Y - ty);
|
||||
j = abs(camactor->int_pos().X - tx);
|
||||
j += abs(camactor->int_pos().Y - ty);
|
||||
if (j < dist)
|
||||
dist = j;
|
||||
}
|
||||
|
@ -534,20 +534,20 @@ void JS_DrawCameras(PLAYER* pp, int tx, int ty, int tz, double smoothratio)
|
|||
tdy = abs(midy - ty);
|
||||
|
||||
if (midx >= tx)
|
||||
dx = camactor->spr.pos.X - tdx;
|
||||
dx = camactor->int_pos().X - tdx;
|
||||
else
|
||||
dx = camactor->spr.pos.X + tdx;
|
||||
dx = camactor->int_pos().X + tdx;
|
||||
|
||||
if (midy >= ty)
|
||||
dy = camactor->spr.pos.Y - tdy;
|
||||
dy = camactor->int_pos().Y - tdy;
|
||||
else
|
||||
dy = camactor->spr.pos.Y + tdy;
|
||||
dy = camactor->int_pos().Y + tdy;
|
||||
|
||||
tdz = abs(tz - camactor->spr.pos.Z);
|
||||
if (tz >= camactor->spr.pos.Z)
|
||||
dz = camactor->spr.pos.Z + tdz;
|
||||
tdz = abs(tz - camactor->int_pos().Z);
|
||||
if (tz >= camactor->int_pos().Z)
|
||||
dz = camactor->int_pos().Z + tdz;
|
||||
else
|
||||
dz = camactor->spr.pos.Z - tdz;
|
||||
dz = camactor->int_pos().Z - tdz;
|
||||
|
||||
|
||||
// Is it a TV cam or a teleporter that shows destination?
|
||||
|
@ -630,7 +630,7 @@ void JS_DrawCameras(PLAYER* pp, int tx, int ty, int tz, double smoothratio)
|
|||
}
|
||||
else
|
||||
{
|
||||
drawroomstotile(camactor->spr.pos.X, camactor->spr.pos.Y, camactor->spr.pos.Z, buildang(SP_TAG5(camactor)), camhoriz, camactor->sector(), mirror[cnt].campic, smoothratio);
|
||||
drawroomstotile(camactor->int_pos().X, camactor->int_pos().Y, camactor->int_pos().Z, buildang(SP_TAG5(camactor)), camhoriz, camactor->sector(), mirror[cnt].campic, smoothratio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -262,7 +262,7 @@ int DoWallBloodDrip(DSWActor* actor)
|
|||
if (actor->user.pos.Z != actor->user.pos.Y)
|
||||
{
|
||||
// if you are between the ceiling and floor fall fast
|
||||
if (actor->spr.pos.Z > actor->user.pos.Y && actor->spr.pos.Z < actor->user.pos.Z)
|
||||
if (actor->int_pos().Z > actor->user.pos.Y && actor->int_pos().Z < actor->user.pos.Z)
|
||||
{
|
||||
actor->spr.zvel += 300;
|
||||
actor->add_int_z(actor->spr.zvel);
|
||||
|
@ -279,7 +279,7 @@ int DoWallBloodDrip(DSWActor* actor)
|
|||
actor->add_int_z(actor->spr.zvel);
|
||||
}
|
||||
|
||||
if (actor->spr.pos.Z >= actor->user.loz)
|
||||
if (actor->int_pos().Z >= actor->user.loz)
|
||||
{
|
||||
actor->set_int_z(actor->user.loz);
|
||||
SpawnFloorSplash(actor);
|
||||
|
@ -293,7 +293,7 @@ int DoWallBloodDrip(DSWActor* actor)
|
|||
void SpawnMidSplash(DSWActor* actor)
|
||||
{
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreSplash, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor), actor->spr.ang, 0);
|
||||
actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor), actor->spr.ang, 0);
|
||||
|
||||
actorNew->spr.shade = -12;
|
||||
actorNew->spr.xrepeat = 70-RandomRange(20);
|
||||
|
@ -316,7 +316,7 @@ void SpawnMidSplash(DSWActor* actor)
|
|||
void SpawnFloorSplash(DSWActor* actor)
|
||||
{
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreFloorSplash, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 0);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, 0);
|
||||
|
||||
actorNew->spr.shade = -12;
|
||||
actorNew->spr.xrepeat = 70-RandomRange(20);
|
||||
|
@ -359,9 +359,9 @@ int DoBloodSpray(DSWActor* actor)
|
|||
// special stuff for blood worm
|
||||
actor->add_int_z((actor->user.change.Z >> 1));
|
||||
|
||||
getzsofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, &cz, &fz);
|
||||
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &cz, &fz);
|
||||
// pretend like we hit a sector
|
||||
if (actor->spr.pos.Z >= fz)
|
||||
if (actor->int_pos().Z >= fz)
|
||||
{
|
||||
actor->set_int_z(fz);
|
||||
SpawnFloorSplash(actor);
|
||||
|
@ -420,7 +420,7 @@ int DoBloodSpray(DSWActor* actor)
|
|||
|
||||
if (wph->lotag == TAG_WALL_BREAK)
|
||||
{
|
||||
HitBreakWall(wph, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, actor->user.ID);
|
||||
HitBreakWall(wph, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, actor->user.ID);
|
||||
actor->user.coll.setNone();
|
||||
break;
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ int DoBloodSpray(DSWActor* actor)
|
|||
|
||||
actor->spr.xvel = actor->spr.yvel = actor->user.change.X = actor->user.change.Y = 0;
|
||||
actor->spr.xrepeat = actor->spr.yrepeat = 70 - RandomRange(25);
|
||||
actor->set_int_xy(bldActor->spr.pos.X, bldActor->spr.pos.Y);
|
||||
actor->set_int_xy(bldActor->int_pos().X, bldActor->int_pos().Y);
|
||||
|
||||
// !FRANK! bit of a hack
|
||||
// yvel is the hit_wall
|
||||
|
@ -453,7 +453,7 @@ int DoBloodSpray(DSWActor* actor)
|
|||
{
|
||||
// sy & sz are the ceiling and floor of the sector you are sliding down
|
||||
if (bldActor->tempwall->twoSided())
|
||||
getzsofslopeptr(bldActor->tempwall->nextSector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.pos.Y, &actor->user.pos.Z);
|
||||
getzsofslopeptr(bldActor->tempwall->nextSector(), actor->int_pos().X, actor->int_pos().Y, &actor->user.pos.Y, &actor->user.pos.Z);
|
||||
else
|
||||
actor->user.pos.Y = actor->user.pos.Z; // ceiling and floor are equal - white wall
|
||||
}
|
||||
|
@ -468,7 +468,7 @@ int DoBloodSpray(DSWActor* actor)
|
|||
case kHitSector:
|
||||
{
|
||||
// hit floor
|
||||
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
{
|
||||
if (actor->user.Flags & (SPR_UNDERWATER))
|
||||
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
|
||||
|
@ -516,7 +516,7 @@ int DoBloodSpray(DSWActor* actor)
|
|||
{
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_BloodSpray, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 100);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, 100);
|
||||
|
||||
SetOwner(actor, actorNew);
|
||||
actorNew->spr.shade = -12;
|
||||
|
@ -615,7 +615,7 @@ int DoPhosphorus(DSWActor* actor)
|
|||
|
||||
if (wph->lotag == TAG_WALL_BREAK)
|
||||
{
|
||||
HitBreakWall(wph, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, actor->user.ID);
|
||||
HitBreakWall(wph, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, actor->user.ID);
|
||||
actor->user.coll.setNone();
|
||||
break;
|
||||
}
|
||||
|
@ -643,7 +643,7 @@ int DoPhosphorus(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
// hit a sector
|
||||
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
{
|
||||
// hit a floor
|
||||
if (!(actor->user.Flags & SPR_BOUNCE))
|
||||
|
@ -672,7 +672,7 @@ int DoPhosphorus(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
// hit floor
|
||||
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
{
|
||||
if (actor->user.Flags & (SPR_UNDERWATER))
|
||||
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
|
||||
|
@ -718,7 +718,7 @@ int DoPhosphorus(DSWActor* actor)
|
|||
{
|
||||
|
||||
auto actorNew = SpawnActor(STAT_SKIP4, PUFF, s_PhosphorExp, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 100);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, 100);
|
||||
|
||||
actorNew->spr.hitag = LUMINOUS; // Always full brightness
|
||||
SetOwner(actor, actorNew);
|
||||
|
@ -818,7 +818,7 @@ int DoChemBomb(DSWActor* actor)
|
|||
|
||||
if (wph->lotag == TAG_WALL_BREAK)
|
||||
{
|
||||
HitBreakWall(wph, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, actor->user.ID);
|
||||
HitBreakWall(wph, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, actor->user.ID);
|
||||
actor->user.coll.setNone();
|
||||
break;
|
||||
}
|
||||
|
@ -849,7 +849,7 @@ int DoChemBomb(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
// hit a sector
|
||||
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
{
|
||||
// hit a floor
|
||||
if (!(actor->user.Flags & SPR_BOUNCE))
|
||||
|
@ -888,7 +888,7 @@ int DoChemBomb(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
// hit floor
|
||||
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
{
|
||||
if (actor->user.Flags & (SPR_UNDERWATER))
|
||||
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
|
||||
|
@ -941,7 +941,7 @@ int DoChemBomb(DSWActor* actor)
|
|||
if (!(actor->user.Flags & (SPR_BOUNCE | SPR_UNDERWATER)) && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
|
||||
{
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 100);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, 100);
|
||||
|
||||
SetOwner(actor, actorNew);
|
||||
actorNew->spr.shade = -40;
|
||||
|
@ -1034,7 +1034,7 @@ int DoCaltrops(DSWActor* actor)
|
|||
|
||||
if (wph->lotag == TAG_WALL_BREAK)
|
||||
{
|
||||
HitBreakWall(wph, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, actor->user.ID);
|
||||
HitBreakWall(wph, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, actor->user.ID);
|
||||
actor->user.coll.setNone();
|
||||
break;
|
||||
}
|
||||
|
@ -1064,7 +1064,7 @@ int DoCaltrops(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
// hit a sector
|
||||
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
{
|
||||
// hit a floor
|
||||
if (!(actor->user.Flags & SPR_BOUNCE))
|
||||
|
@ -1094,7 +1094,7 @@ int DoCaltrops(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
// hit floor
|
||||
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
|
||||
{
|
||||
if (actor->user.Flags & (SPR_UNDERWATER))
|
||||
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
|
||||
|
@ -1170,7 +1170,7 @@ int SpawnRadiationCloud(DSWActor* actor)
|
|||
return -1;
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, RADIATION_CLOUD, s_RadiationCloud, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - RANDOM_P2(Z(8)), actor->spr.ang, 0);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - RANDOM_P2(Z(8)), actor->spr.ang, 0);
|
||||
|
||||
SetOwner(GetOwner(actor), actorNew);
|
||||
actorNew->user.WaitTics = 1 * 120;
|
||||
|
@ -1306,9 +1306,9 @@ int InitSpriteChemBomb(DSWActor* actor)
|
|||
|
||||
PlaySound(DIGI_THROW, actor, v3df_dontpan | v3df_doppler);
|
||||
|
||||
nx = actor->spr.pos.X;
|
||||
ny = actor->spr.pos.Y;
|
||||
nz = actor->spr.pos.Z;
|
||||
nx = actor->int_pos().X;
|
||||
ny = actor->int_pos().Y;
|
||||
nz = actor->int_pos().Z;
|
||||
|
||||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
@ -1348,9 +1348,9 @@ int InitChemBomb(DSWActor* actor)
|
|||
{
|
||||
int nx, ny, nz;
|
||||
|
||||
nx = actor->spr.pos.X;
|
||||
ny = actor->spr.pos.Y;
|
||||
nz = actor->spr.pos.Z;
|
||||
nx = actor->int_pos().X;
|
||||
ny = actor->int_pos().Y;
|
||||
nz = actor->int_pos().Z;
|
||||
|
||||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
@ -1425,14 +1425,14 @@ int PlayerInitFlashBomb(PLAYER* pp)
|
|||
if (itActor == pp->actor)
|
||||
break;
|
||||
|
||||
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, tx, ty, tmin);
|
||||
DISTANCE(itActor->int_pos().X, itActor->int_pos().Y, actor->int_pos().X, actor->int_pos().Y, dist, tx, ty, tmin);
|
||||
if (dist > 16384) // Flash radius
|
||||
continue;
|
||||
|
||||
if (!(actor->spr.cstat & CSTAT_SPRITE_BLOCK))
|
||||
continue;
|
||||
|
||||
if (!FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - ActorSizeZ(actor), actor->sector()))
|
||||
if (!FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ActorSizeZ(actor), actor->sector()))
|
||||
continue;
|
||||
|
||||
damage = GetDamage(itActor, pp->actor, DMG_FLASHBOMB);
|
||||
|
@ -1484,14 +1484,14 @@ int InitFlashBomb(DSWActor* actor)
|
|||
SWStatIterator it(StatDamageList[stat]);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, tx, ty, tmin);
|
||||
DISTANCE(itActor->int_pos().X, itActor->int_pos().Y, actor->int_pos().X, actor->int_pos().Y, dist, tx, ty, tmin);
|
||||
if (dist > 16384) // Flash radius
|
||||
continue;
|
||||
|
||||
if (!(actor->spr.cstat & CSTAT_SPRITE_BLOCK))
|
||||
continue;
|
||||
|
||||
if (!FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - ActorSizeZ(actor), actor->sector()))
|
||||
if (!FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ActorSizeZ(actor), actor->sector()))
|
||||
continue;
|
||||
|
||||
damage = GetDamage(itActor, actor, DMG_FLASHBOMB);
|
||||
|
@ -1569,7 +1569,7 @@ void SpawnFlashBombOnActor(DSWActor* actor)
|
|||
}
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL_FLAMES, s_FireballFlames, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 0);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, 0);
|
||||
|
||||
if (actor->user.flameActor != nullptr)
|
||||
actor->user.flameActor = actorNew;
|
||||
|
@ -1676,9 +1676,9 @@ int InitCaltrops(DSWActor* actor)
|
|||
|
||||
PlaySound(DIGI_THROW, actor, v3df_dontpan | v3df_doppler);
|
||||
|
||||
nx = actor->spr.pos.X;
|
||||
ny = actor->spr.pos.Y;
|
||||
nz = actor->spr.pos.Z;
|
||||
nx = actor->int_pos().X;
|
||||
ny = actor->int_pos().Y;
|
||||
nz = actor->int_pos().Z;
|
||||
|
||||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
@ -1718,9 +1718,9 @@ int InitPhosphorus(DSWActor* actor)
|
|||
|
||||
PlaySound(DIGI_FIREBALL1, actor, v3df_follow);
|
||||
|
||||
nx = actor->spr.pos.X;
|
||||
ny = actor->spr.pos.Y;
|
||||
nz = actor->spr.pos.Z;
|
||||
nx = actor->int_pos().X;
|
||||
ny = actor->int_pos().Y;
|
||||
nz = actor->int_pos().Z;
|
||||
|
||||
daang = NORM_ANGLE(RandomRange(2048));
|
||||
|
||||
|
@ -1797,8 +1797,8 @@ int InitBloodSpray(DSWActor* actor, bool dogib, short velocity)
|
|||
else
|
||||
ang = NORM_ANGLE(ang+1024+256 - RandomRange(256));
|
||||
|
||||
nx = actor->spr.pos.X;
|
||||
ny = actor->spr.pos.Y;
|
||||
nx = actor->int_pos().X;
|
||||
ny = actor->int_pos().Y;
|
||||
nz = ActorZOfTop(actor)-20;
|
||||
|
||||
// Spawn a shot
|
||||
|
@ -1880,7 +1880,7 @@ DSWActor* DoFlagRangeTest(DSWActor* actor, int range)
|
|||
SWStatIterator it(StatDamageList[stat]);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, tx, ty, tmin);
|
||||
DISTANCE(itActor->int_pos().X, itActor->int_pos().Y, actor->int_pos().X, actor->int_pos().Y, dist, tx, ty, tmin);
|
||||
if (dist > range)
|
||||
continue;
|
||||
|
||||
|
@ -1893,10 +1893,10 @@ DSWActor* DoFlagRangeTest(DSWActor* actor, int range)
|
|||
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
|
||||
continue;
|
||||
|
||||
if (!FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector()))
|
||||
if (!FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector()))
|
||||
continue;
|
||||
|
||||
dist = FindDistance3D(actor->spr.pos - itActor->spr.pos);
|
||||
dist = FindDistance3D(actor->int_pos() - itActor->int_pos());
|
||||
if (dist > range)
|
||||
continue;
|
||||
|
||||
|
@ -1918,7 +1918,7 @@ int DoCarryFlag(DSWActor* actor)
|
|||
// if no Owner then die
|
||||
if (attached != nullptr)
|
||||
{
|
||||
vec3_t pos = { attached->spr.pos.X, attached->spr.pos.Y, ActorZOfMiddle(attached) };
|
||||
vec3_t pos = { attached->int_pos().X, attached->int_pos().Y, ActorZOfMiddle(attached) };
|
||||
SetActorZ(actor, &pos);
|
||||
actor->spr.ang = NORM_ANGLE(attached->spr.ang + 1536);
|
||||
}
|
||||
|
@ -2067,10 +2067,10 @@ int DoCarryFlagNoDet(DSWActor* actor)
|
|||
// if no Owner then die
|
||||
if (attached != nullptr)
|
||||
{
|
||||
vec3_t pos = { attached->spr.pos.X, attached->spr.pos.Y, ActorZOfMiddle(attached) };
|
||||
vec3_t pos = { attached->int_pos().X, attached->int_pos().Y, ActorZOfMiddle(attached) };
|
||||
SetActorZ(actor, &pos);
|
||||
actor->spr.ang = NORM_ANGLE(attached->spr.ang + 1536);
|
||||
actor->set_int_z(attached->spr.pos.Z - (ActorSizeZ(attached) >> 1));
|
||||
actor->set_int_z(attached->int_pos().Z - (ActorSizeZ(attached) >> 1));
|
||||
}
|
||||
|
||||
if (!attached->hasU() || attached->user.Health <= 0)
|
||||
|
@ -2143,7 +2143,7 @@ int DoFlag(DSWActor* actor)
|
|||
// attach weapon to sprite
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
SetAttach(hitActor, actor);
|
||||
actor->user.pos.Z = hitActor->spr.pos.Z - (ActorSizeZ(hitActor) >> 1);
|
||||
actor->user.pos.Z = hitActor->int_pos().Z - (ActorSizeZ(hitActor) >> 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2160,8 +2160,8 @@ int SpawnShell(DSWActor* actor, int ShellNum)
|
|||
extern STATE s_ShotgunShellShrap[];
|
||||
|
||||
|
||||
nx = actor->spr.pos.X;
|
||||
ny = actor->spr.pos.Y;
|
||||
nx = actor->int_pos().X;
|
||||
ny = actor->int_pos().Y;
|
||||
nz = ActorZOfMiddle(actor);
|
||||
|
||||
switch (ShellNum)
|
||||
|
|
|
@ -472,7 +472,7 @@ int SetupLava(DSWActor* actor)
|
|||
actor->spr.clipdist = (512) >> 2;
|
||||
actor->user.Flags |= (SPR_XFLIP_TOGGLE|SPR_ELECTRO_TOLERANT);
|
||||
|
||||
actor->user.loz = actor->spr.pos.Z;
|
||||
actor->user.loz = actor->int_pos().Z;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
|
||||
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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
|
||||
|
||||
if (!(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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
|
||||
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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
|
||||
|
||||
if (!(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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
|
||||
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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
|
||||
|
||||
if (!(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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
|
||||
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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
|
||||
|
||||
if (!(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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
|
||||
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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
|
||||
|
||||
if (!(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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
|
||||
|
||||
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->sector(),actor->user.targetActor->spr.pos.X,actor->user.targetActor->spr.pos.Y,actor->user.targetActor->spr.pos.Z,actor->user.targetActor->sector());
|
||||
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
|
||||
|
||||
if (!(actor->user.Flags & SPR_CLIMBING))
|
||||
KeepActorOnFloor(actor);
|
||||
|
|
|
@ -1163,7 +1163,7 @@ DSWActor* DoPickTarget(DSWActor* actor, uint32_t max_delta_ang, int skip_targets
|
|||
|
||||
// Only look at closest ones
|
||||
//if ((dist = Distance(actor->spr.x, actor->spr.y, itActor->spr.x, itActor->spr.y)) > PICK_DIST)
|
||||
if ((dist = FindDistance3D(actor->spr.pos - itActor->spr.pos)) > PICK_DIST)
|
||||
if ((dist = FindDistance3D(actor->int_pos() - itActor->int_pos())) > PICK_DIST)
|
||||
continue;
|
||||
|
||||
if (skip_targets != 2) // Used for spriteinfo mode
|
||||
|
@ -1174,7 +1174,7 @@ DSWActor* DoPickTarget(DSWActor* actor, uint32_t max_delta_ang, int skip_targets
|
|||
}
|
||||
|
||||
// Get the angle to the player
|
||||
angle2 = NORM_ANGLE(getangle(itActor->spr.pos.X - actor->spr.pos.X, itActor->spr.pos.Y - actor->spr.pos.Y));
|
||||
angle2 = NORM_ANGLE(getangle(itActor->int_pos().X - actor->int_pos().X, itActor->int_pos().Y - actor->int_pos().Y));
|
||||
|
||||
// Get the angle difference
|
||||
// delta_ang = labs(pp->angle.ang.asbuild() - angle2);
|
||||
|
@ -1195,9 +1195,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->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ezh, itActor->sector()) &&
|
||||
!FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, zh, actor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ezhm, itActor->sector()) &&
|
||||
!FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, zh, actor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, ezhl, itActor->sector())
|
||||
if (!FAFcansee(actor->int_pos().X, actor->int_pos().Y, zh, actor->sector(), itActor->int_pos().X, itActor->int_pos().Y, ezh, itActor->sector()) &&
|
||||
!FAFcansee(actor->int_pos().X, actor->int_pos().Y, zh, actor->sector(), itActor->int_pos().X, itActor->int_pos().Y, ezhm, itActor->sector()) &&
|
||||
!FAFcansee(actor->int_pos().X, actor->int_pos().Y, zh, actor->sector(), itActor->int_pos().X, itActor->int_pos().Y, ezhl, itActor->sector())
|
||||
)
|
||||
continue;
|
||||
|
||||
|
@ -1300,14 +1300,14 @@ void DoSpawnTeleporterEffect(DSWActor* actor)
|
|||
nx = MOVEx(512, actor->spr.ang);
|
||||
ny = MOVEy(512, actor->spr.ang);
|
||||
|
||||
nx += actor->spr.pos.X;
|
||||
ny += actor->spr.pos.Y;
|
||||
nx += actor->int_pos().X;
|
||||
ny += actor->int_pos().Y;
|
||||
|
||||
auto effectActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(),
|
||||
nx, ny, ActorZOfTop(actor) + Z(16),
|
||||
actor->spr.ang, 0);
|
||||
|
||||
SetActorZ(effectActor, effectActor->spr.pos);
|
||||
SetActorZ(effectActor, effectActor->int_pos());
|
||||
|
||||
effectActor->spr.shade = -40;
|
||||
effectActor->spr.xrepeat = effectActor->spr.yrepeat = 42;
|
||||
|
@ -1322,10 +1322,10 @@ void DoSpawnTeleporterEffectPlace(DSWActor* actor)
|
|||
extern STATE s_TeleportEffect[];
|
||||
|
||||
auto effectActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, ActorZOfTop(actor) + Z(16),
|
||||
actor->int_pos().X, actor->int_pos().Y, ActorZOfTop(actor) + Z(16),
|
||||
actor->spr.ang, 0);
|
||||
|
||||
SetActorZ(effectActor, effectActor->spr.pos);
|
||||
SetActorZ(effectActor, effectActor->int_pos());
|
||||
|
||||
effectActor->spr.shade = -40;
|
||||
effectActor->spr.xrepeat = effectActor->spr.yrepeat = 42;
|
||||
|
@ -1363,7 +1363,7 @@ void DoPlayerWarpTeleporter(PLAYER* pp)
|
|||
break;
|
||||
default:
|
||||
{
|
||||
auto pos = act_warp->spr.pos;
|
||||
auto pos = act_warp->int_pos();
|
||||
DoPlayerTeleportToSprite(pp, &pos, act_warp->spr.ang);
|
||||
act_warp->set_int_pos(pos);
|
||||
|
||||
|
@ -1716,7 +1716,7 @@ void UpdatePlayerUnderSprite(PLAYER* pp)
|
|||
|
||||
DSWActor* act_under = pp->PlayerUnderActor;
|
||||
|
||||
act_under->set_int_pos(act_over->spr.pos);
|
||||
act_under->set_int_pos(act_over->int_pos());
|
||||
ChangeActorSect(act_under, act_over->sector());
|
||||
|
||||
SpriteWarpToUnderwater(act_under);
|
||||
|
@ -1871,7 +1871,7 @@ void DoPlayerZrange(PLAYER* pp)
|
|||
if (fsp->spr.statnum == STAT_ENEMY && floorColl.actor()->user.ID == ZOMBIE_RUN_R0)
|
||||
{
|
||||
pp->lo_sectp = fsp->sector();
|
||||
pp->loz = fsp->spr.pos.Z;
|
||||
pp->loz = fsp->int_pos().Z;
|
||||
pp->lowActor = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -2376,7 +2376,7 @@ void DriveCrush(PLAYER* pp, int *x, int *y)
|
|||
SWSectIterator it(sop->op_main_sector);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
if (testpointinquad(actor->spr.pos.X, actor->spr.pos.Y, x, y))
|
||||
if (testpointinquad(actor->int_pos().X, actor->int_pos().Y, x, y))
|
||||
{
|
||||
if ((actor->spr.extra & SPRX_BREAKABLE) && HitBreakSprite(actor, 0))
|
||||
continue;
|
||||
|
@ -2399,7 +2399,7 @@ void DriveCrush(PLAYER* pp, int *x, int *y)
|
|||
if (actor->spr.statnum > STAT_DONT_DRAW)
|
||||
continue;
|
||||
|
||||
if (actor->spr.pos.Z < sop->crush_z)
|
||||
if (actor->int_pos().Z < sop->crush_z)
|
||||
continue;
|
||||
|
||||
SpriteQueueDelete(actor);
|
||||
|
@ -2411,10 +2411,10 @@ void DriveCrush(PLAYER* pp, int *x, int *y)
|
|||
SWStatIterator it2(STAT_ENEMY);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
if (testpointinquad(actor->spr.pos.X, actor->spr.pos.Y, x, y))
|
||||
if (testpointinquad(actor->int_pos().X, actor->int_pos().Y, x, y))
|
||||
{
|
||||
//if (actor->spr.z < pp->posz)
|
||||
if (actor->spr.pos.Z < sop->crush_z)
|
||||
if (actor->int_pos().Z < sop->crush_z)
|
||||
continue;
|
||||
|
||||
int32_t const vel = FindDistance2D(pp->vect.X>>8, pp->vect.Y>>8);
|
||||
|
@ -2438,9 +2438,9 @@ void DriveCrush(PLAYER* pp, int *x, int *y)
|
|||
it2.Reset(STAT_DEAD_ACTOR);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
if (testpointinquad(actor->spr.pos.X, actor->spr.pos.Y, x, y))
|
||||
if (testpointinquad(actor->int_pos().X, actor->int_pos().Y, x, y))
|
||||
{
|
||||
if (actor->spr.pos.Z < sop->crush_z)
|
||||
if (actor->int_pos().Z < sop->crush_z)
|
||||
continue;
|
||||
|
||||
SpriteQueueDelete(actor);
|
||||
|
@ -2460,12 +2460,12 @@ void DriveCrush(PLAYER* pp, int *x, int *y)
|
|||
if (actor->user.PlayerP == pp)
|
||||
continue;
|
||||
|
||||
if (testpointinquad(actor->spr.pos.X, actor->spr.pos.Y, x, y))
|
||||
if (testpointinquad(actor->int_pos().X, actor->int_pos().Y, x, y))
|
||||
{
|
||||
int damage;
|
||||
|
||||
//if (actor->spr.z < pp->posz)
|
||||
if (actor->spr.pos.Z < sop->crush_z)
|
||||
if (actor->int_pos().Z < sop->crush_z)
|
||||
continue;
|
||||
|
||||
damage = -(actor->user.Health + 100);
|
||||
|
@ -2483,7 +2483,7 @@ void DriveCrush(PLAYER* pp, int *x, int *y)
|
|||
while (auto actor = it.Next())
|
||||
{
|
||||
// give some extra buffer
|
||||
if (actor->spr.pos.Z < sop->crush_z + Z(40))
|
||||
if (actor->int_pos().Z < sop->crush_z + Z(40))
|
||||
continue;
|
||||
|
||||
if ((actor->spr.extra & SPRX_PLAYER_OR_ENEMY))
|
||||
|
@ -3197,7 +3197,7 @@ void DoPlayerClimb(PLAYER* pp)
|
|||
}
|
||||
|
||||
// sprite
|
||||
auto pos = plActor->spr.pos;
|
||||
auto pos = plActor->int_pos();
|
||||
if (pos.X != plActor->user.pos.X)
|
||||
{
|
||||
if (pos.X < plActor->user.pos.X)
|
||||
|
@ -3350,8 +3350,8 @@ void DoPlayerClimb(PLAYER* pp)
|
|||
// set players "view" distance from the ladder - needs to be farther than
|
||||
// the sprite
|
||||
|
||||
pp->LadderPosition.X = lActor->spr.pos.X + nx * 5;
|
||||
pp->LadderPosition.Y = lActor->spr.pos.Y + ny * 5;
|
||||
pp->LadderPosition.X = lActor->int_pos().X + nx * 5;
|
||||
pp->LadderPosition.Y = lActor->int_pos().Y + ny * 5;
|
||||
|
||||
pp->angle.settarget(buildang(lActor->spr.ang + 1024));
|
||||
}
|
||||
|
@ -3644,7 +3644,7 @@ DSWActor* FindNearSprite(DSWActor* actor, short stat)
|
|||
SWStatIterator it(stat);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y);
|
||||
dist = Distance(actor->int_pos().X, actor->int_pos().Y, itActor->int_pos().X, itActor->int_pos().Y);
|
||||
|
||||
if (dist < near_dist)
|
||||
{
|
||||
|
@ -3732,8 +3732,8 @@ bool PlayerOnLadder(PLAYER* pp)
|
|||
// set players "view" distance from the ladder - needs to be farther than
|
||||
// the sprite
|
||||
|
||||
pp->LadderPosition.X = lActor->spr.pos.X + nx * 5;
|
||||
pp->LadderPosition.Y = lActor->spr.pos.Y + ny * 5;
|
||||
pp->LadderPosition.X = lActor->int_pos().X + nx * 5;
|
||||
pp->LadderPosition.Y = lActor->int_pos().Y + ny * 5;
|
||||
|
||||
pp->angle.settarget(buildang(lActor->spr.ang + 1024));
|
||||
|
||||
|
@ -4037,12 +4037,12 @@ void DoPlayerWarpToUnderwater(PLAYER* pp)
|
|||
PRODUCTION_ASSERT(Found == true);
|
||||
|
||||
// get the offset from the sprite
|
||||
plActor->user.pos.X = over_act->spr.pos.X - pp->pos.X;
|
||||
plActor->user.pos.Y = over_act->spr.pos.Y - pp->pos.Y;
|
||||
plActor->user.pos.X = over_act->int_pos().X - pp->pos.X;
|
||||
plActor->user.pos.Y = over_act->int_pos().Y - pp->pos.Y;
|
||||
|
||||
// update to the new x y position
|
||||
pp->pos.X = under_act->spr.pos.X - plActor->user.pos.X;
|
||||
pp->pos.Y = under_act->spr.pos.Y - plActor->user.pos.Y;
|
||||
pp->pos.X = under_act->int_pos().X - plActor->user.pos.X;
|
||||
pp->pos.Y = under_act->int_pos().Y - plActor->user.pos.Y;
|
||||
|
||||
auto over = over_act->sector();
|
||||
auto under = under_act->sector();
|
||||
|
@ -4107,12 +4107,12 @@ void DoPlayerWarpToSurface(PLAYER* pp)
|
|||
PRODUCTION_ASSERT(Found == true);
|
||||
|
||||
// get the offset from the under sprite
|
||||
plActor->user.pos.X = under_act->spr.pos.X - pp->pos.X;
|
||||
plActor->user.pos.Y = under_act->spr.pos.Y - pp->pos.Y;
|
||||
plActor->user.pos.X = under_act->int_pos().X - pp->pos.X;
|
||||
plActor->user.pos.Y = under_act->int_pos().Y - pp->pos.Y;
|
||||
|
||||
// update to the new x y position
|
||||
pp->pos.X = over_act->spr.pos.X - plActor->user.pos.X;
|
||||
pp->pos.Y = over_act->spr.pos.Y - plActor->user.pos.Y;
|
||||
pp->pos.X = over_act->int_pos().X - plActor->user.pos.X;
|
||||
pp->pos.Y = over_act->int_pos().Y - plActor->user.pos.Y;
|
||||
|
||||
auto over = over_act->sector();
|
||||
auto under = under_act->sector();
|
||||
|
@ -5090,8 +5090,8 @@ void PlayerRemoteReset(PLAYER* pp, sectortype* sect)
|
|||
pp->lastcursector = pp->cursector;
|
||||
|
||||
auto rsp = pp->remoteActor;
|
||||
pp->pos.X = rsp->spr.pos.X;
|
||||
pp->pos.Y = rsp->spr.pos.Y;
|
||||
pp->pos.X = rsp->int_pos().X;
|
||||
pp->pos.Y = rsp->int_pos().Y;
|
||||
pp->pos.Z = sect->floorz - PLAYER_HEIGHT;
|
||||
|
||||
pp->vect.X = pp->vect.Y = pp->ovect.X = pp->ovect.Y = pp->slide_vect.X = pp->slide_vect.Y = 0;
|
||||
|
@ -5718,9 +5718,9 @@ void DoPlayerDeathFollowKiller(PLAYER* pp)
|
|||
DSWActor* killer = pp->KillerActor;
|
||||
if (killer)
|
||||
{
|
||||
if (FAFcansee(killer->spr.pos.X, killer->spr.pos.Y, ActorZOfTop(killer), killer->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector))
|
||||
if (FAFcansee(killer->int_pos().X, killer->int_pos().Y, ActorZOfTop(killer), killer->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector))
|
||||
{
|
||||
pp->angle.addadjustment(getincanglebam(pp->angle.ang, bvectangbam(killer->spr.pos.X - pp->pos.X, killer->spr.pos.Y - pp->pos.Y)) >> 4);
|
||||
pp->angle.addadjustment(getincanglebam(pp->angle.ang, bvectangbam(killer->int_pos().X - pp->pos.X, killer->int_pos().Y - pp->pos.Y)) >> 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5837,13 +5837,13 @@ void DoPlayerDeathCheckKick(PLAYER* pp)
|
|||
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
|
||||
continue;
|
||||
|
||||
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, plActor->spr.pos.X, plActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(itActor->int_pos().X, itActor->int_pos().Y, plActor->int_pos().X, plActor->int_pos().Y, dist, a, b, c);
|
||||
|
||||
if (unsigned(dist) < itActor->user.Radius + 100)
|
||||
{
|
||||
pp->KillerActor = itActor;
|
||||
|
||||
plActor->user.slide_ang = getangle(plActor->spr.pos.X - itActor->spr.pos.X, plActor->spr.pos.Y - itActor->spr.pos.Y);
|
||||
plActor->user.slide_ang = getangle(plActor->int_pos().X - itActor->int_pos().X, plActor->int_pos().Y - itActor->int_pos().Y);
|
||||
plActor->user.slide_ang = NORM_ANGLE(plActor->user.slide_ang + (RANDOM_P2(128<<5)>>5) - 64);
|
||||
|
||||
plActor->user.slide_vel = itActor->spr.xvel<<1;
|
||||
|
@ -5914,8 +5914,8 @@ void DoPlayerDeathMoveHead(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
pp->pos.X = plActor->spr.pos.X;
|
||||
pp->pos.Y = plActor->spr.pos.Y;
|
||||
pp->pos.X = plActor->int_pos().X;
|
||||
pp->pos.Y = plActor->int_pos().Y;
|
||||
pp->setcursector(plActor->sector());
|
||||
|
||||
// try to stay in valid area - death sometimes throws you out of the map
|
||||
|
@ -6786,7 +6786,7 @@ int SearchSpawnPosition(PLAYER* pp)
|
|||
|
||||
if (opp != pp) // don't test for yourself
|
||||
{
|
||||
if (FindDistance3D(spawn_sprite->spr.pos - opp->pos) < 1000)
|
||||
if (FindDistance3D(spawn_sprite->int_pos() - opp->pos) < 1000)
|
||||
{
|
||||
blocked = true;
|
||||
break;
|
||||
|
@ -6864,7 +6864,7 @@ void PlayerSpawnPosition(PLAYER* pp)
|
|||
|
||||
ASSERT(spawn_sprite != nullptr);
|
||||
|
||||
pp->pos = pp->opos = spawn_sprite->spr.pos;
|
||||
pp->pos = pp->opos = spawn_sprite->int_pos();
|
||||
pp->angle.ang = pp->angle.oang = buildang(spawn_sprite->spr.ang);
|
||||
pp->setcursector(spawn_sprite->sector());
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ void QuakeViewChange(PLAYER* pp, int *z_diff, int *x_diff, int *y_diff, short *a
|
|||
SWStatIterator it(STAT_QUAKE_ON);
|
||||
while ((actor = it.Next()))
|
||||
{
|
||||
dist = FindDistance3D(pp->pos - actor->spr.pos);
|
||||
dist = FindDistance3D(pp->pos - actor->int_pos());
|
||||
|
||||
// shake whole level
|
||||
if (QUAKE_TestDontTaper(actor))
|
||||
|
@ -248,13 +248,13 @@ bool SetQuake(PLAYER* pp, short tics, short amt)
|
|||
|
||||
int SetExpQuake(DSWActor* actor)
|
||||
{
|
||||
SpawnQuake(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 40, 4, 20000); // !JIM! was 8, 40000
|
||||
SpawnQuake(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 40, 4, 20000); // !JIM! was 8, 40000
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SetGunQuake(DSWActor* actor)
|
||||
{
|
||||
SpawnQuake(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 40, 8, 40000);
|
||||
SpawnQuake(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 40, 8, 40000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -266,19 +266,19 @@ int SetPlayerQuake(PLAYER* pp)
|
|||
|
||||
int SetNuclearQuake(DSWActor* actor)
|
||||
{
|
||||
SpawnQuake(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 400, 8, 64000);
|
||||
SpawnQuake(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 400, 8, 64000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SetSumoQuake(DSWActor* actor)
|
||||
{
|
||||
SpawnQuake(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 120, 4, 20000);
|
||||
SpawnQuake(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 120, 4, 20000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SetSumoFartQuake(DSWActor* actor)
|
||||
{
|
||||
SpawnQuake(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 60, 4, 4000);
|
||||
SpawnQuake(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 60, 4, 4000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -929,7 +929,7 @@ int InitRipperHang(DSWActor* actor)
|
|||
{
|
||||
tang = NORM_ANGLE(actor->spr.ang + dang);
|
||||
|
||||
FAFhitscan(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - ActorSizeZ(actor), actor->sector(), // Start position
|
||||
FAFhitscan(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ActorSizeZ(actor), actor->sector(), // Start position
|
||||
bcos(tang), // X vector of 3D ang
|
||||
bsin(tang), // Y vector of 3D ang
|
||||
0, // Z vector of 3D ang
|
||||
|
@ -938,7 +938,7 @@ int InitRipperHang(DSWActor* actor)
|
|||
if (hit.hitSector == nullptr)
|
||||
continue;
|
||||
|
||||
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, hit.hitpos.X, hit.hitpos.Y);
|
||||
dist = Distance(actor->int_pos().X, actor->int_pos().Y, hit.hitpos.X, hit.hitpos.Y);
|
||||
|
||||
if (hit.hitWall == nullptr || dist < 2000 || dist > 7000)
|
||||
{
|
||||
|
@ -1045,7 +1045,7 @@ int DoRipperBeginJumpAttack(DSWActor* actor)
|
|||
DSWActor* target = actor->user.targetActor;
|
||||
short tang;
|
||||
|
||||
tang = getangle(target->spr.pos.X - actor->spr.pos.X, target->spr.pos.Y - actor->spr.pos.Y);
|
||||
tang = getangle(target->int_pos().X - actor->int_pos().X, target->int_pos().Y - actor->int_pos().Y);
|
||||
|
||||
Collision coll = move_sprite(actor, bcos(tang, -7), bsin(tang, -7),
|
||||
0L, actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS);
|
||||
|
@ -1149,7 +1149,7 @@ int DoRipperRipHeart(DSWActor* actor)
|
|||
actor->user.WaitTics = 6 * 120;
|
||||
|
||||
// player face ripper
|
||||
target->spr.ang = getangle(actor->spr.pos.X - target->spr.pos.X, actor->spr.pos.Y - target->spr.pos.Y);
|
||||
target->spr.ang = getangle(actor->int_pos().X - target->int_pos().X, actor->int_pos().Y - target->int_pos().Y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1174,7 +1174,7 @@ void RipperHatch(DSWActor* actor)
|
|||
{
|
||||
auto actorNew = insertActor(actor->sector(), STAT_DEFAULT);
|
||||
ClearOwner(actorNew);
|
||||
actorNew->set_int_pos(actor->spr.pos);
|
||||
actorNew->set_int_pos(actor->int_pos());
|
||||
actorNew->spr.xrepeat = actorNew->spr.yrepeat = 64;
|
||||
actorNew->spr.ang = rip_ang[i];
|
||||
actorNew->spr.pal = 0;
|
||||
|
|
|
@ -938,7 +938,7 @@ int InitRipper2Hang(DSWActor* actor)
|
|||
{
|
||||
tang = NORM_ANGLE(actor->spr.ang + dang);
|
||||
|
||||
FAFhitscan(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - ActorSizeZ(actor), actor->sector(), // Start position
|
||||
FAFhitscan(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ActorSizeZ(actor), actor->sector(), // Start position
|
||||
bcos(tang), // X vector of 3D ang
|
||||
bsin(tang), // Y vector of 3D ang
|
||||
0, // Z vector of 3D ang
|
||||
|
@ -947,7 +947,7 @@ int InitRipper2Hang(DSWActor* actor)
|
|||
if (hit.hitSector == nullptr)
|
||||
continue;
|
||||
|
||||
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, hit.hitpos.X, hit.hitpos.Y);
|
||||
dist = Distance(actor->int_pos().X, actor->int_pos().Y, hit.hitpos.X, hit.hitpos.Y);
|
||||
|
||||
if (hit.hitWall == nullptr || dist < 2000 || dist > 7000)
|
||||
{
|
||||
|
@ -1012,7 +1012,7 @@ int DoRipper2MoveHang(DSWActor* actor)
|
|||
short w, nw;
|
||||
|
||||
// Don't keep clinging and going ever higher!
|
||||
if (abs(actor->spr.pos.Z - actor->user.targetActor->spr.pos.Z) > (4000<<4))
|
||||
if (abs(actor->int_pos().Z - actor->user.targetActor->int_pos().Z) > (4000<<4))
|
||||
return 0;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Special[1]);
|
||||
|
@ -1065,7 +1065,7 @@ int DoRipper2BeginJumpAttack(DSWActor* actor)
|
|||
DSWActor* target = actor->user.targetActor;
|
||||
short tang;
|
||||
|
||||
tang = getangle(target->spr.pos.X - actor->spr.pos.X, target->spr.pos.Y - actor->spr.pos.Y);
|
||||
tang = getangle(target->int_pos().X - actor->int_pos().X, target->int_pos().Y - actor->int_pos().Y);
|
||||
|
||||
// Always jump at player if mad.
|
||||
|
||||
|
@ -1171,7 +1171,7 @@ int DoRipper2RipHeart(DSWActor* actor)
|
|||
actor->user.WaitTics = 6 * 120;
|
||||
|
||||
// player face ripper2
|
||||
target->spr.ang = getangle(actor->spr.pos.X - target->spr.pos.X, actor->spr.pos.Y - target->spr.pos.Y);
|
||||
target->spr.ang = getangle(actor->int_pos().X - target->int_pos().X, actor->int_pos().Y - target->int_pos().Y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1199,7 +1199,7 @@ void Ripper2Hatch(DSWActor* actor)
|
|||
{
|
||||
auto actorNew = insertActor(actor->sector(), STAT_DEFAULT);
|
||||
ClearOwner(actorNew);
|
||||
actorNew->set_int_pos(actor->spr.pos);
|
||||
actorNew->set_int_pos(actor->int_pos());
|
||||
|
||||
actorNew->spr.xrepeat = actorNew->spr.yrepeat = 64;
|
||||
actorNew->spr.ang = rip_ang[i];
|
||||
|
|
|
@ -672,8 +672,8 @@ bool FindCeilingView(int match, int* x, int* y, int z, sectortype** sect)
|
|||
{
|
||||
if (actor->spr.hitag == VIEW_THRU_CEILING && actor->spr.lotag == match)
|
||||
{
|
||||
xoff = *x - actor->spr.pos.X;
|
||||
yoff = *y - actor->spr.pos.Y;
|
||||
xoff = *x - actor->int_pos().X;
|
||||
yoff = *y - actor->int_pos().Y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -688,8 +688,8 @@ bool FindCeilingView(int match, int* x, int* y, int z, sectortype** sect)
|
|||
{
|
||||
sectortype* upper,* lower;
|
||||
|
||||
*x = actor->spr.pos.X + xoff;
|
||||
*y = actor->spr.pos.Y + yoff;
|
||||
*x = actor->int_pos().X + xoff;
|
||||
*y = actor->int_pos().Y + yoff;
|
||||
|
||||
// get new sector
|
||||
GetUpperLowerSector(match, *x, *y, &upper, &lower);
|
||||
|
@ -729,8 +729,8 @@ bool FindFloorView(int match, int* x, int* y, int z, sectortype** sect)
|
|||
{
|
||||
if (actor->spr.hitag == VIEW_THRU_FLOOR && actor->spr.lotag == match)
|
||||
{
|
||||
xoff = *x - actor->spr.pos.X;
|
||||
yoff = *y - actor->spr.pos.Y;
|
||||
xoff = *x - actor->int_pos().X;
|
||||
yoff = *y - actor->int_pos().Y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -746,8 +746,8 @@ bool FindFloorView(int match, int* x, int* y, int z, sectortype** sect)
|
|||
{
|
||||
sectortype* upper,* lower;
|
||||
|
||||
*x = actor->spr.pos.X + xoff;
|
||||
*y = actor->spr.pos.Y + yoff;
|
||||
*x = actor->int_pos().X + xoff;
|
||||
*y = actor->int_pos().Y + yoff;
|
||||
|
||||
// get new sector
|
||||
GetUpperLowerSector(match, *x, *y, &upper, &lower);
|
||||
|
@ -867,9 +867,9 @@ void CollectPortals()
|
|||
SWSectIterator it(sec);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
int tx = actor->spr.pos.X;
|
||||
int ty = actor->spr.pos.Y;
|
||||
int tz = actor->spr.pos.Z;
|
||||
int tx = actor->int_pos().X;
|
||||
int ty = actor->int_pos().Y;
|
||||
int tz = actor->int_pos().Z;
|
||||
auto tsect = §or[sec];
|
||||
|
||||
int match = FindViewSectorInScene(tsect, VIEW_LEVEL1);
|
||||
|
@ -881,7 +881,7 @@ void CollectPortals()
|
|||
// got something!
|
||||
fp.othersector = sectnum(tsect);
|
||||
fp.offset = { tx, ty, tz };
|
||||
fp.offset -= actor->spr.pos;
|
||||
fp.offset -= actor->int_pos();
|
||||
goto nextfg;
|
||||
}
|
||||
}
|
||||
|
@ -897,9 +897,9 @@ void CollectPortals()
|
|||
SWSectIterator it(sec);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
int tx = actor->spr.pos.X;
|
||||
int ty = actor->spr.pos.Y;
|
||||
int tz = actor->spr.pos.Z;
|
||||
int tx = actor->int_pos().X;
|
||||
int ty = actor->int_pos().Y;
|
||||
int tz = actor->int_pos().Z;
|
||||
auto tsect = §or[sec];
|
||||
|
||||
int match = FindViewSectorInScene(tsect, VIEW_LEVEL2);
|
||||
|
@ -911,7 +911,7 @@ void CollectPortals()
|
|||
// got something!
|
||||
fp.othersector = sectnum(tsect);
|
||||
fp.offset = { tx, ty, tz };
|
||||
fp.offset -= actor->spr.pos;
|
||||
fp.offset -= actor->int_pos();
|
||||
goto nextcg;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -326,7 +326,7 @@ int DoRotator(DSWActor* actor)
|
|||
{
|
||||
if (itActor->spr.lotag == actor->spr.lotag)
|
||||
{
|
||||
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y);
|
||||
dist = Distance(actor->int_pos().X, actor->int_pos().Y, itActor->int_pos().X, itActor->int_pos().Y);
|
||||
if (dist < closest)
|
||||
{
|
||||
closest = dist;
|
||||
|
@ -343,7 +343,7 @@ int DoRotator(DSWActor* actor)
|
|||
for(auto& wal : wallsofsector(actor->sector()))
|
||||
{
|
||||
vec2_t const orig = { r->origX[ndx], r->origY[ndx] };
|
||||
rotatepoint(pivot->spr.pos.vec2, orig, r->pos, &nxy);
|
||||
rotatepoint(pivot->int_pos().vec2, orig, r->pos, &nxy);
|
||||
|
||||
dragpoint(&wal, nxy.X, nxy.Y);
|
||||
ndx++;
|
||||
|
|
|
@ -124,7 +124,7 @@ void WallSetupDontMove(void)
|
|||
{
|
||||
for(auto& wal : wall)
|
||||
{
|
||||
if (wal.wall_int_pos().X < jActor->spr.pos.X && wal.wall_int_pos().X > iActor->spr.pos.X && wal.wall_int_pos().Y < jActor->spr.pos.Y && wal.wall_int_pos().Y > iActor->spr.pos.Y)
|
||||
if (wal.wall_int_pos().X < jActor->int_pos().X && wal.wall_int_pos().X > iActor->int_pos().X && wal.wall_int_pos().Y < jActor->int_pos().Y && wal.wall_int_pos().Y > iActor->int_pos().Y)
|
||||
{
|
||||
wal.extra |= WALLFX_DONT_MOVE;
|
||||
}
|
||||
|
@ -841,7 +841,7 @@ void SectorExp(DSWActor* actor, sectortype* sectp, short orig_ang, int zh)
|
|||
|
||||
// setup vars needed by SectorExp
|
||||
ChangeActorSect(actor, sectp);
|
||||
getzsofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.hiz, &actor->user.loz);
|
||||
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &actor->user.hiz, &actor->user.loz);
|
||||
|
||||
// spawn explosion
|
||||
auto exp = SpawnSectorExp(actor);
|
||||
|
@ -929,7 +929,7 @@ void DoSpawnSpotsForKill(short match)
|
|||
change_actor_stat(actor, STAT_NO_STATE);
|
||||
actor->user.ActorActionFunc = DoSpawnSpot;
|
||||
actor->user.WaitTics = SP_TAG5(actor) * 15;
|
||||
SetActorZ(actor, actor->spr.pos);
|
||||
SetActorZ(actor, actor->int_pos());
|
||||
// setting for Killed
|
||||
actor->user.LastDamage = 1;
|
||||
}
|
||||
|
@ -1133,7 +1133,7 @@ void WeaponExplodeSectorInRange(DSWActor* wActor)
|
|||
while (auto actor = it.Next())
|
||||
{
|
||||
// test to see if explosion is close to crack sprite
|
||||
dist = FindDistance3D(wActor->spr.pos - actor->spr.pos);
|
||||
dist = FindDistance3D(wActor->int_pos() - actor->int_pos());
|
||||
|
||||
if (actor->spr.clipdist == 0)
|
||||
continue;
|
||||
|
@ -1143,7 +1143,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->sector(),actor->spr.pos.X,actor->spr.pos.Y,actor->spr.pos.Z,actor->sector()))
|
||||
if (!FAFcansee(wActor->int_pos().X,wActor->int_pos().Y,wActor->int_pos().Z,wActor->sector(),actor->int_pos().X,actor->int_pos().Y,actor->int_pos().Z,actor->sector()))
|
||||
continue;
|
||||
|
||||
|
||||
|
@ -1200,8 +1200,8 @@ void DoDeleteSpriteMatch(short match)
|
|||
if (actor->spr.lotag == match)
|
||||
{
|
||||
found = actor;
|
||||
del_x = actor->spr.pos.X;
|
||||
del_y = actor->spr.pos.Y;
|
||||
del_x = actor->int_pos().X;
|
||||
del_y = actor->int_pos().Y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1214,7 +1214,7 @@ void DoDeleteSpriteMatch(short match)
|
|||
it.Reset(StatList[stat]);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
if (del_x == actor->spr.pos.X && del_y == actor->spr.pos.Y)
|
||||
if (del_x == actor->int_pos().X && del_y == actor->int_pos().Y)
|
||||
{
|
||||
// special case lighting delete of Fade On/off after fades
|
||||
if (StatList[stat] == STAT_LIGHTING)
|
||||
|
@ -1380,7 +1380,7 @@ int OperateSprite(DSWActor* actor, short player_is_operating)
|
|||
{
|
||||
pp = GlobPlayerP;
|
||||
|
||||
if (!FAFcansee(pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - (ActorSizeZ(actor) >> 1), actor->sector()))
|
||||
if (!FAFcansee(pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (ActorSizeZ(actor) >> 1), actor->sector()))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1837,7 +1837,7 @@ void OperateTripTrigger(PLAYER* pp)
|
|||
{
|
||||
if (actor->user.Flags & (SPR_WAIT_FOR_TRIGGER))
|
||||
{
|
||||
if (Distance(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y) < dist)
|
||||
if (Distance(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y) < dist)
|
||||
{
|
||||
actor->user.targetActor = pp->actor;
|
||||
actor->user.Flags &= ~(SPR_WAIT_FOR_TRIGGER);
|
||||
|
@ -2128,7 +2128,7 @@ int DoPlayerGrabStar(PLAYER* pp)
|
|||
auto actor = StarQueue[i];
|
||||
if (actor != nullptr)
|
||||
{
|
||||
if (FindDistance3D(actor->spr.pos.X - pp->pos.X, actor->spr.pos.Y - pp->pos.Y, actor->spr.pos.Z - pp->pos.Z + Z(12)) < 500)
|
||||
if (FindDistance3D(actor->int_pos().X - pp->pos.X, actor->int_pos().Y - pp->pos.Y, actor->int_pos().Z - pp->pos.Z + Z(12)) < 500)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -2205,8 +2205,8 @@ void PlayerOperateEnv(PLAYER* pp)
|
|||
int z[3];
|
||||
DSWActor* plActor = pp->actor;
|
||||
|
||||
z[0] = plActor->spr.pos.Z - ActorSizeZ(plActor) - Z(10);
|
||||
z[1] = plActor->spr.pos.Z;
|
||||
z[0] = plActor->int_pos().Z - ActorSizeZ(plActor) - Z(10);
|
||||
z[1] = plActor->int_pos().Z;
|
||||
z[2] = (z[0] + z[1]) >> 1;
|
||||
|
||||
for (unsigned i = 0; i < SIZ(z); i++)
|
||||
|
|
|
@ -730,7 +730,7 @@ int SetupSerp(DSWActor* actor)
|
|||
actor->spr.clipdist = (512) >> 2;
|
||||
actor->user.Flags |= (SPR_XFLIP_TOGGLE|SPR_ELECTRO_TOLERANT);
|
||||
|
||||
actor->user.loz = actor->spr.pos.Z;
|
||||
actor->user.loz = actor->int_pos().Z;
|
||||
|
||||
// amount to move up for clipmove
|
||||
actor->user.zclip = Z(80);
|
||||
|
|
|
@ -236,14 +236,14 @@ int SetupSkull(DSWActor* actor)
|
|||
{
|
||||
actor->set_int_z(actor->user.loz + Z(tileTopOffset(actor->spr.picnum)));
|
||||
|
||||
actor->user.loz = actor->spr.pos.Z;
|
||||
actor->user.loz = actor->int_pos().Z;
|
||||
// leave 8 pixels above the ground
|
||||
actor->add_int_z(ActorSizeToTop(actor) - Z(3));
|
||||
}
|
||||
else
|
||||
{
|
||||
actor->user.Counter = RANDOM_P2(2048);
|
||||
actor->user.pos.Z = actor->spr.pos.Z;
|
||||
actor->user.pos.Z = actor->int_pos().Z;
|
||||
}
|
||||
|
||||
|
||||
|
@ -363,7 +363,7 @@ int DoSkullJump(DSWActor* actor)
|
|||
|
||||
int dist,a,b,c;
|
||||
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y, dist, a, b, c);
|
||||
|
||||
if (dist < 1000 &&
|
||||
SpriteOverlapZ(actor, actor->user.targetActor, Z(32)))
|
||||
|
@ -373,7 +373,7 @@ int DoSkullJump(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ((actor->spr.pos.Z > actor->user.loz - Z(36)))
|
||||
if ((actor->int_pos().Z > actor->user.loz - Z(36)))
|
||||
{
|
||||
actor->set_int_z(actor->user.loz - Z(36));
|
||||
UpdateSinglePlayKills(actor);
|
||||
|
@ -425,7 +425,7 @@ int DoSkullWait(DSWActor* actor)
|
|||
{
|
||||
int a,b,c,dist;
|
||||
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y, dist, a, b, c);
|
||||
|
||||
DoActorPickClosePlayer(actor);
|
||||
|
||||
|
@ -439,7 +439,7 @@ int DoSkullWait(DSWActor* actor)
|
|||
}
|
||||
|
||||
// below the floor type
|
||||
if (actor->spr.pos.Z > actor->user.loz)
|
||||
if (actor->int_pos().Z > actor->user.loz)
|
||||
{
|
||||
// look for closest player every once in a while
|
||||
if (dist < 3500)
|
||||
|
@ -459,7 +459,7 @@ int DoSkullWait(DSWActor* actor)
|
|||
|
||||
if (dist < 8000)
|
||||
{
|
||||
actor->spr.ang = getangle(actor->user.targetActor->spr.pos.X - actor->spr.pos.X, actor->user.targetActor->spr.pos.Y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y);
|
||||
actor->spr.xvel = 128 + (RANDOM_P2(256<<8)>>8);
|
||||
actor->user.jump_speed = -700;
|
||||
NewStateGroup(actor, sg_SkullJump);
|
||||
|
@ -621,14 +621,14 @@ int SetupBetty(DSWActor* actor)
|
|||
{
|
||||
actor->set_int_z(actor->user.loz + Z(tileTopOffset(actor->spr.picnum)));
|
||||
|
||||
actor->user.loz = actor->spr.pos.Z;
|
||||
actor->user.loz = actor->int_pos().Z;
|
||||
// leave 8 pixels above the ground
|
||||
actor->add_int_z(ActorSizeToTop(actor) - Z(3));
|
||||
}
|
||||
else
|
||||
{
|
||||
actor->user.Counter = RANDOM_P2(2048);
|
||||
actor->user.pos.Z = actor->spr.pos.Z;
|
||||
actor->user.pos.Z = actor->int_pos().Z;
|
||||
}
|
||||
|
||||
|
||||
|
@ -741,7 +741,7 @@ int DoBettyJump(DSWActor* actor)
|
|||
{
|
||||
int dist,a,b,c;
|
||||
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y, dist, a, b, c);
|
||||
|
||||
if (dist < 1000 &&
|
||||
SpriteOverlapZ(actor, actor->user.targetActor, Z(32)))
|
||||
|
@ -751,7 +751,7 @@ int DoBettyJump(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ((actor->spr.pos.Z > actor->user.loz - Z(36)))
|
||||
if ((actor->int_pos().Z > actor->user.loz - Z(36)))
|
||||
{
|
||||
actor->set_int_z(actor->user.loz - Z(36));
|
||||
UpdateSinglePlayKills(actor);
|
||||
|
@ -800,7 +800,7 @@ int DoBettyWait(DSWActor* actor)
|
|||
{
|
||||
int a,b,c,dist;
|
||||
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->int_pos().X, actor->int_pos().Y, actor->user.targetActor->int_pos().X, actor->user.targetActor->int_pos().Y, dist, a, b, c);
|
||||
|
||||
DoActorPickClosePlayer(actor);
|
||||
|
||||
|
@ -811,7 +811,7 @@ int DoBettyWait(DSWActor* actor)
|
|||
}
|
||||
|
||||
// below the floor type
|
||||
if (actor->spr.pos.Z > actor->user.loz)
|
||||
if (actor->int_pos().Z > actor->user.loz)
|
||||
{
|
||||
// look for closest player every once in a while
|
||||
if (dist < 3500)
|
||||
|
@ -831,7 +831,7 @@ int DoBettyWait(DSWActor* actor)
|
|||
|
||||
if (dist < 8000)
|
||||
{
|
||||
actor->spr.ang = getangle(actor->user.targetActor->spr.pos.X - actor->spr.pos.X, actor->user.targetActor->spr.pos.Y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y);
|
||||
actor->spr.xvel = 128 + (RANDOM_P2(256<<8)>>8);
|
||||
actor->user.jump_speed = -700;
|
||||
NewStateGroup(actor, sg_BettyJump);
|
||||
|
|
|
@ -375,12 +375,12 @@ static void UpdateAmbients()
|
|||
for (auto& amb : ambients)
|
||||
{
|
||||
auto spot = amb->spot;
|
||||
auto sdist = SoundDist(spot->spr.pos.X, spot->spr.pos.Y, spot->spr.pos.Z, voc[amb->vocIndex].voc_distance);
|
||||
auto sdist = SoundDist(spot->int_pos().X, spot->int_pos().Y, spot->int_pos().Z, voc[amb->vocIndex].voc_distance);
|
||||
|
||||
if (sdist < 255 && amb->vocIndex == DIGI_WHIPME)
|
||||
{
|
||||
PLAYER* pp = Player + screenpeek;
|
||||
if (!FAFcansee(spot->spr.pos.X, spot->spr.pos.Y, spot->spr.pos.Z, spot->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector))
|
||||
if (!FAFcansee(spot->int_pos().X, spot->int_pos().Y, spot->int_pos().Z, spot->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector))
|
||||
{
|
||||
sdist = 255;
|
||||
}
|
||||
|
@ -644,7 +644,7 @@ int _PlaySound(int num, DSWActor* actor, PLAYER* pp, vec3_t* ppos, int flags, in
|
|||
{
|
||||
if (actor && !ppos)
|
||||
{
|
||||
pos = actor->spr.pos;
|
||||
pos = actor->int_pos();
|
||||
actor = nullptr;
|
||||
}
|
||||
else if (pp && !ppos)
|
||||
|
|
|
@ -51,15 +51,15 @@ void ReverseSpike(DSWActor* actor)
|
|||
// moving toward to OFF pos
|
||||
if (actor->user.z_tgt == actor->user.oz)
|
||||
{
|
||||
if (actor->spr.pos.Z == actor->user.oz)
|
||||
if (actor->int_pos().Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
else if (actor->user.pos.Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
}
|
||||
else if (actor->user.z_tgt == actor->user.pos.Z)
|
||||
{
|
||||
if (actor->spr.pos.Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
if (actor->int_pos().Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
else if (actor->user.pos.Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ void SetSpikeActive(DSWActor* actor)
|
|||
actor->user.Tics = 0;
|
||||
|
||||
// moving to the ON position
|
||||
if (actor->user.z_tgt == actor->spr.pos.Z)
|
||||
if (actor->user.z_tgt == actor->int_pos().Z)
|
||||
VatorSwitch(SP_TAG2(actor), true);
|
||||
else
|
||||
// moving to the OFF position
|
||||
|
@ -232,16 +232,16 @@ void SpikeAlign(DSWActor* actor)
|
|||
if ((int8_t)SP_TAG7(actor) < 0)
|
||||
{
|
||||
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
|
||||
alignceilslope(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->user.zclip);
|
||||
alignceilslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
|
||||
else
|
||||
alignflorslope(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->user.zclip);
|
||||
alignflorslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
|
||||
SOBJ_AlignCeilingToPoint(&SectorObject[SP_TAG7(actor)], actor->spr.pos.X, actor->spr.pos.Y, actor->user.zclip);
|
||||
SOBJ_AlignCeilingToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
|
||||
else
|
||||
SOBJ_AlignFloorToPoint(&SectorObject[SP_TAG7(actor)], actor->spr.pos.X, actor->spr.pos.Y, actor->user.zclip);
|
||||
SOBJ_AlignFloorToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ void MoveSpritesWithSpike(sectortype* sect)
|
|||
if ((actor->spr.extra & SPRX_STAY_PUT_VATOR))
|
||||
continue;
|
||||
|
||||
getzsofslopeptr(sect, actor->spr.pos.X, actor->spr.pos.Y, &cz, &fz);
|
||||
getzsofslopeptr(sect, actor->int_pos().X, actor->int_pos().Y, &cz, &fz);
|
||||
actor->set_int_z(fz);
|
||||
}
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ int DoSpike(DSWActor* actor)
|
|||
if (*lptr == actor->user.z_tgt)
|
||||
{
|
||||
// in the ON position
|
||||
if (actor->user.z_tgt == actor->spr.pos.Z)
|
||||
if (actor->user.z_tgt == actor->int_pos().Z)
|
||||
{
|
||||
// change target
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
|
@ -302,7 +302,7 @@ int DoSpike(DSWActor* actor)
|
|||
// change target
|
||||
actor->user.jump_speed = actor->user.vel_tgt;
|
||||
actor->user.vel_rate = (short)abs(actor->user.vel_rate);
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
|
||||
SetSpikeInactive(actor);
|
||||
|
||||
|
@ -387,7 +387,7 @@ int DoSpikeAuto(DSWActor* actor)
|
|||
if (*lptr == actor->user.z_tgt)
|
||||
{
|
||||
// in the UP position
|
||||
if (actor->user.z_tgt == actor->spr.pos.Z)
|
||||
if (actor->user.z_tgt == actor->int_pos().Z)
|
||||
{
|
||||
// change target
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
|
@ -404,7 +404,7 @@ int DoSpikeAuto(DSWActor* actor)
|
|||
// change target
|
||||
actor->user.jump_speed = actor->user.vel_tgt;
|
||||
actor->user.vel_rate = (short)abs(actor->user.vel_rate);
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
actor->user.Tics = actor->user.WaitTics;
|
||||
|
||||
if (SP_TAG6(actor) && TEST_BOOL5(actor))
|
||||
|
|
|
@ -958,7 +958,7 @@ bool ActorTestSpawn(DSWActor* actor)
|
|||
default: c = "?"; break;
|
||||
}
|
||||
Printf("WARNING: skill-masked %s at %d,%d,%d not being killed because it "
|
||||
"activates something\n", c, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z);
|
||||
"activates something\n", c, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z);
|
||||
return true;
|
||||
}
|
||||
//always spawn girls in addons
|
||||
|
@ -1439,8 +1439,8 @@ void PreMapCombineFloors(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
dx = BoundList[base_offset].offset->spr.pos.X - BoundList[i].offset->spr.pos.X;
|
||||
dy = BoundList[base_offset].offset->spr.pos.Y - BoundList[i].offset->spr.pos.Y;
|
||||
dx = BoundList[base_offset].offset->int_pos().X - BoundList[i].offset->int_pos().X;
|
||||
dy = BoundList[base_offset].offset->int_pos().Y - BoundList[i].offset->int_pos().Y;
|
||||
|
||||
BFSSectorSearch search(BoundList[i].offset->sector());
|
||||
while (auto dasect = search.GetNext())
|
||||
|
@ -1511,8 +1511,8 @@ void SpriteSetupPost(void)
|
|||
if (jActor->hasU())
|
||||
continue;
|
||||
|
||||
getzsofslopeptr(jActor->sector(), jActor->spr.pos.X, jActor->spr.pos.Y, &cz, &fz);
|
||||
if (labs(jActor->spr.pos.Z - fz) > Z(4))
|
||||
getzsofslopeptr(jActor->sector(), jActor->int_pos().X, jActor->int_pos().Y, &cz, &fz);
|
||||
if (labs(jActor->int_pos().Z - fz) > Z(4))
|
||||
continue;
|
||||
|
||||
SpawnUser(jActor, 0, nullptr);
|
||||
|
@ -1560,8 +1560,8 @@ void SpriteSetup(void)
|
|||
while (auto actor = it.Next())
|
||||
{
|
||||
// not used yetv
|
||||
getzsofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, &cz, &fz);
|
||||
if (actor->spr.pos.Z > ((cz + fz) >> 1))
|
||||
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &cz, &fz);
|
||||
if (actor->int_pos().Z > ((cz + fz) >> 1))
|
||||
{
|
||||
// closer to a floor
|
||||
actor->spr.cstat |= (CSTAT_SPRITE_CLOSE_FLOOR);
|
||||
|
@ -1856,7 +1856,7 @@ void SpriteSetup(void)
|
|||
|
||||
case SECT_WALL_PAN_SPEED:
|
||||
{
|
||||
vec3_t hit_pos = { actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - Z(8) };
|
||||
vec3_t hit_pos = { actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - Z(8) };
|
||||
HitInfo hit{};
|
||||
|
||||
hitscan(hit_pos, actor->sector(), // Start position
|
||||
|
@ -1885,7 +1885,7 @@ void SpriteSetup(void)
|
|||
|
||||
case WALL_DONT_STICK:
|
||||
{
|
||||
vec3_t hit_pos = { actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - Z(8) };
|
||||
vec3_t hit_pos = { actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - Z(8) };
|
||||
HitInfo hit{};
|
||||
|
||||
hitscan(hit_pos, actor->sector(), // Start position
|
||||
|
@ -2045,11 +2045,11 @@ void SpriteSetup(void)
|
|||
{
|
||||
// start off
|
||||
actor->user.pos.Z = sectp->floorz;
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
if (start_on)
|
||||
{
|
||||
int amt;
|
||||
amt = actor->spr.pos.Z - sectp->floorz;
|
||||
amt = actor->int_pos().Z - sectp->floorz;
|
||||
|
||||
// start in the on position
|
||||
sectp->addfloorz(amt);
|
||||
|
@ -2065,11 +2065,11 @@ void SpriteSetup(void)
|
|||
{
|
||||
// start off
|
||||
actor->user.pos.Z = sectp->ceilingz;
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
if (start_on)
|
||||
{
|
||||
int amt;
|
||||
amt = actor->spr.pos.Z - sectp->ceilingz;
|
||||
amt = actor->int_pos().Z - sectp->ceilingz;
|
||||
|
||||
// starting in the on position
|
||||
sectp->addceilingz(amt);
|
||||
|
@ -2243,7 +2243,7 @@ void SpriteSetup(void)
|
|||
break;
|
||||
}
|
||||
|
||||
getzrangepoint(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector(), &ceilingz, &trash, &floorz, &trash);
|
||||
getzrangepoint(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), &ceilingz, &trash, &floorz, &trash);
|
||||
|
||||
if (floor_vator)
|
||||
{
|
||||
|
@ -2251,11 +2251,11 @@ void SpriteSetup(void)
|
|||
|
||||
// start off
|
||||
actor->user.pos.Z = actor->user.zclip;
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
if (start_on)
|
||||
{
|
||||
// start in the on position
|
||||
actor->user.zclip = actor->spr.pos.Z;
|
||||
actor->user.zclip = actor->int_pos().Z;
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
SpikeAlign(actor);
|
||||
}
|
||||
|
@ -2269,11 +2269,11 @@ void SpriteSetup(void)
|
|||
|
||||
// start off
|
||||
actor->user.pos.Z = actor->user.zclip;
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
if (start_on)
|
||||
{
|
||||
// starting in the on position
|
||||
actor->user.zclip = actor->spr.pos.Z;
|
||||
actor->user.zclip = actor->int_pos().Z;
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
SpikeAlign(actor);
|
||||
}
|
||||
|
@ -2486,7 +2486,7 @@ void SpriteSetup(void)
|
|||
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos(actor->spr.pos);
|
||||
actorNew->set_int_pos(actor->int_pos());
|
||||
actorNew->spr.ang = NORM_ANGLE(actor->spr.ang + 1024);
|
||||
actorNew->spr.picnum = actor->spr.picnum;
|
||||
|
||||
|
@ -2576,7 +2576,7 @@ void SpriteSetup(void)
|
|||
{
|
||||
if (itActor->spr.hitag == actor->spr.hitag && itActor->spr.lotag == actor->spr.lotag)
|
||||
{
|
||||
I_Error("Two VIEW_THRU_ tags with same match found on level\n1: x %d, y %d \n2: x %d, y %d", actor->spr.pos.X, actor->spr.pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y);
|
||||
I_Error("Two VIEW_THRU_ tags with same match found on level\n1: x %d, y %d \n2: x %d, y %d", actor->int_pos().X, actor->int_pos().Y, itActor->int_pos().X, itActor->int_pos().Y);
|
||||
}
|
||||
}
|
||||
change_actor_stat(actor, STAT_FAF);
|
||||
|
@ -3514,7 +3514,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) });
|
||||
actorNew->spr.ang = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
@ -3553,7 +3553,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) });
|
||||
actorNew->spr.ang = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
@ -3579,7 +3579,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) });
|
||||
actorNew->spr.ang = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
@ -3608,7 +3608,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) });
|
||||
actorNew->spr.ang = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
@ -3668,7 +3668,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) });
|
||||
actorNew->spr.ang = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
@ -3724,7 +3724,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorLowerZ(actor) + Z(10) });
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorLowerZ(actor) + Z(10) });
|
||||
actorNew->spr.ang = actor->spr.ang;
|
||||
|
||||
// vel
|
||||
|
@ -3804,7 +3804,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_REPAIR_KIT))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_REPAIR_KIT, s_RepairKit, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_REPAIR_KIT, s_RepairKit, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3815,7 +3815,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_STAR))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_STAR, s_IconStar, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_STAR, s_IconStar, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3826,7 +3826,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_LG_MINE))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_MINE, s_IconLgMine, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_MINE, s_IconLgMine, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3837,7 +3837,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_MICRO_GUN))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_MICRO_GUN, s_IconMicroGun, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_MICRO_GUN, s_IconMicroGun, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3848,7 +3848,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_MICRO_BATTERY))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_MICRO_BATTERY, s_IconMicroBattery, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_MICRO_BATTERY, s_IconMicroBattery, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3859,7 +3859,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_GRENADE_LAUNCHER))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_GRENADE_LAUNCHER, s_IconGrenadeLauncher, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_GRENADE_LAUNCHER, s_IconGrenadeLauncher, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3870,7 +3870,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_LG_GRENADE))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_GRENADE, s_IconLgGrenade, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_GRENADE, s_IconLgGrenade, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3881,7 +3881,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_RAIL_GUN))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_RAIL_GUN, s_IconRailGun, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_RAIL_GUN, s_IconRailGun, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3892,7 +3892,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_RAIL_AMMO))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_RAIL_AMMO, s_IconRailAmmo, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_RAIL_AMMO, s_IconRailAmmo, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3903,7 +3903,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_ROCKET))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_ROCKET, s_IconRocket, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_ROCKET, s_IconRocket, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3914,7 +3914,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_SHOTGUN))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_SHOTGUN, s_IconShotgun, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_SHOTGUN, s_IconShotgun, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3925,7 +3925,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_LG_SHOTSHELL))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_SHOTSHELL, s_IconLgShotshell, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_SHOTSHELL, s_IconLgShotshell, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3936,7 +3936,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_GUARD_HEAD))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_GUARD_HEAD, s_IconGuardHead, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_GUARD_HEAD, s_IconGuardHead, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3947,7 +3947,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_FIREBALL_LG_AMMO))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_FIREBALL_LG_AMMO, s_IconFireballLgAmmo, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_FIREBALL_LG_AMMO, s_IconFireballLgAmmo, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3958,7 +3958,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_HEART))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART, s_IconHeart, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART, s_IconHeart, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3969,7 +3969,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_HEART_LG_AMMO))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART_LG_AMMO, s_IconHeartLgAmmo, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART_LG_AMMO, s_IconHeartLgAmmo, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3981,7 +3981,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_ARMOR))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_ARMOR, s_IconArmor, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_ARMOR, s_IconArmor, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -3998,7 +3998,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_MEDKIT))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_MEDKIT, s_IconMedkit, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_MEDKIT, s_IconMedkit, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4009,7 +4009,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_SM_MEDKIT))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_SM_MEDKIT, s_IconSmMedkit, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_SM_MEDKIT, s_IconSmMedkit, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4020,7 +4020,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_CHEMBOMB))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_CHEMBOMB, s_IconChemBomb, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_CHEMBOMB, s_IconChemBomb, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4031,7 +4031,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_FLASHBOMB))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_FLASHBOMB, s_IconFlashBomb, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_FLASHBOMB, s_IconFlashBomb, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4042,7 +4042,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_NUKE))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_NUKE, s_IconNuke, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_NUKE, s_IconNuke, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4053,7 +4053,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_CALTROPS))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_CALTROPS, s_IconCaltrops, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_CALTROPS, s_IconCaltrops, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4064,7 +4064,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_BOOSTER))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_BOOSTER, s_IconBooster, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_BOOSTER, s_IconBooster, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4075,7 +4075,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_HEAT_CARD))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_HEAT_CARD, s_IconHeatCard, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_HEAT_CARD, s_IconHeatCard, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4086,7 +4086,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_CLOAK))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_CLOAK, s_IconCloak, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_CLOAK, s_IconCloak, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4097,7 +4097,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_NIGHT_VISION))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_NIGHT_VISION, s_IconNightVision, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_NIGHT_VISION, s_IconNightVision, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4109,7 +4109,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_LG_UZI_AMMO))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_UZI_AMMO, s_IconLgUziAmmo, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_UZI_AMMO, s_IconLgUziAmmo, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4120,7 +4120,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_GUARD_HEAD))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_GUARD_HEAD, s_IconGuardHead, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_GUARD_HEAD, s_IconGuardHead, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4131,7 +4131,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_HEART))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART, s_IconHeart, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART, s_IconHeart, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4143,7 +4143,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_UZIFLOOR))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_UZIFLOOR, s_IconUziFloor, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_UZIFLOOR, s_IconUziFloor, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4157,7 +4157,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, ICON_UZI))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_UZI, s_IconUzi, itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, ICON_UZI, s_IconUzi, itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN;
|
||||
IconDefault(spawnedActor);
|
||||
|
||||
|
@ -4203,7 +4203,7 @@ int SpawnItemsMatch(short match)
|
|||
if (!ItemSpotClear(itActor, STAT_ITEM, s_Key[num]->Pic))
|
||||
break;
|
||||
|
||||
spawnedActor = SpawnActor(STAT_ITEM, s_Key[num]->Pic, s_Key[num], itActor->sector(), itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.ang, 0);
|
||||
spawnedActor = SpawnActor(STAT_ITEM, s_Key[num]->Pic, s_Key[num], itActor->sector(), itActor->int_pos().X, itActor->int_pos().Y, itActor->int_pos().Z, itActor->spr.ang, 0);
|
||||
|
||||
spawnedActor->spr.picnum = spawnedActor->user.ID = s_Key[num]->Pic;
|
||||
|
||||
|
@ -4258,7 +4258,7 @@ bool SpriteOverlap(DSWActor* actor_a, DSWActor* actor_b)
|
|||
int spa_tos, spa_bos, spb_tos, spb_bos, overlap_z;
|
||||
|
||||
if (!actor_a->hasU() || !actor_b->hasU()) return false;
|
||||
if ((unsigned)Distance(actor_a->spr.pos.X, actor_a->spr.pos.Y, actor_b->spr.pos.X, actor_b->spr.pos.Y) > actor_a->user.Radius + actor_b->user.Radius)
|
||||
if ((unsigned)Distance(actor_a->int_pos().X, actor_a->int_pos().Y, actor_b->int_pos().X, actor_b->int_pos().Y) > actor_a->user.Radius + actor_b->user.Radius)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -4345,7 +4345,7 @@ void getzrangepoint(int x, int y, int z, sectortype* sect,
|
|||
if ((cstat & (CSTAT_SPRITE_ALIGNMENT_MASK | CSTAT_SPRITE_BLOCK)) != (CSTAT_SPRITE_ALIGNMENT_FLOOR|CSTAT_SPRITE_BLOCK))
|
||||
continue; // Only check blocking floor sprites
|
||||
|
||||
daz = itActor->spr.pos.Z;
|
||||
daz = itActor->int_pos().Z;
|
||||
|
||||
// Only check if sprite's 2-sided or your on the 1-sided side
|
||||
if (((cstat & CSTAT_SPRITE_ONE_SIDE) != 0) && ((z > daz) == ((cstat & CSTAT_SPRITE_YFLIP) == 0)))
|
||||
|
@ -4369,8 +4369,8 @@ void getzrangepoint(int x, int y, int z, sectortype* sect,
|
|||
dax = ((xspan >> 1) + xoff) * itActor->spr.xrepeat;
|
||||
yspan = tileHeight(tilenum);
|
||||
day = ((yspan >> 1) + yoff) * itActor->spr.yrepeat;
|
||||
x1 = itActor->spr.pos.X + DMulScale(sinang, dax, cosang, day, 16) - x;
|
||||
y1 = itActor->spr.pos.Y + DMulScale(sinang, day, -cosang, dax, 16) - y;
|
||||
x1 = itActor->int_pos().X + DMulScale(sinang, dax, cosang, day, 16) - x;
|
||||
y1 = itActor->int_pos().Y + DMulScale(sinang, day, -cosang, dax, 16) - y;
|
||||
l = xspan * itActor->spr.xrepeat;
|
||||
x2 = x1 - MulScale(sinang, l, 16);
|
||||
y2 = y1 + MulScale(cosang, l, 16);
|
||||
|
@ -4444,7 +4444,7 @@ void DoActorZrange(DSWActor* actor)
|
|||
|
||||
auto save_cstat = actor->spr.cstat & CSTAT_SPRITE_BLOCK;
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
||||
vec3_t pos = actor->spr.pos;
|
||||
vec3_t pos = actor->int_pos();
|
||||
pos.Z -= (ActorSizeZ(actor) >> 1);
|
||||
FAFgetzrange(pos, actor->sector(), &actor->user.hiz, &ceilhit, &actor->user.loz, &florhit, (((int) actor->spr.clipdist) << 2) - GETZRANGE_CLIP_ADJ, CLIPMASK_ACTOR);
|
||||
actor->spr.cstat |= save_cstat;
|
||||
|
@ -4573,14 +4573,14 @@ bool DropAhead(DSWActor* actor, int min_height)
|
|||
// dax = actor->spr.x + MOVEx(128, actor->spr.ang);
|
||||
// day = actor->spr.y + MOVEy(128, actor->spr.ang);
|
||||
|
||||
dax = actor->spr.pos.X + MOVEx(256, actor->spr.ang);
|
||||
day = actor->spr.pos.Y + MOVEy(256, actor->spr.ang);
|
||||
dax = actor->int_pos().X + MOVEx(256, actor->spr.ang);
|
||||
day = actor->int_pos().Y + MOVEy(256, actor->spr.ang);
|
||||
|
||||
auto newsector = actor->sector();
|
||||
updatesector(dax, day, &newsector);
|
||||
|
||||
// look straight down for a drop
|
||||
if (ActorDrop(actor, dax, day, actor->spr.pos.Z, newsector, min_height))
|
||||
if (ActorDrop(actor, dax, day, actor->int_pos().Z, newsector, min_height))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -4614,9 +4614,9 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
|
|||
}
|
||||
|
||||
// save off x,y values
|
||||
x = actor->spr.pos.X;
|
||||
y = actor->spr.pos.Y;
|
||||
z = actor->spr.pos.Z;
|
||||
x = actor->int_pos().X;
|
||||
y = actor->int_pos().Y;
|
||||
z = actor->int_pos().Z;
|
||||
loz = actor->user.loz;
|
||||
hiz = actor->user.hiz;
|
||||
lowActor = actor->user.lowActor;
|
||||
|
@ -4633,7 +4633,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
|
|||
// try and determine whether you moved > lo_step in the z direction
|
||||
if (!(actor->user.Flags & (SPR_NO_SCAREDZ | SPR_JUMPING | SPR_CLIMBING | SPR_FALLING | SPR_DEAD | SPR_SWIMMING)))
|
||||
{
|
||||
if (labs(actor->spr.pos.Z - globloz) > actor->user.lo_step)
|
||||
if (labs(actor->int_pos().Z - globloz) > actor->user.lo_step)
|
||||
{
|
||||
// cancel move
|
||||
actor->set_int_pos({ x, y, z });
|
||||
|
@ -4649,7 +4649,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (ActorDrop(actor, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector(), actor->user.lo_step))
|
||||
if (ActorDrop(actor, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), actor->user.lo_step))
|
||||
{
|
||||
// cancel move
|
||||
actor->set_int_pos({ x, y, z });
|
||||
|
@ -4671,7 +4671,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
|
|||
if (actor->user.coll.type == kHitNone)
|
||||
{
|
||||
// Keep track of how far sprite has moved
|
||||
dist = Distance(x, y, actor->spr.pos.X, actor->spr.pos.Y);
|
||||
dist = Distance(x, y, actor->int_pos().X, actor->int_pos().Y);
|
||||
actor->user.TargetDist -= dist;
|
||||
actor->user.Dist += dist;
|
||||
actor->user.DistCheck += dist;
|
||||
|
@ -4723,7 +4723,7 @@ int DoGrating(DSWActor* actor)
|
|||
actor->clearUser();
|
||||
}
|
||||
|
||||
SetActorZ(actor, actor->spr.pos);
|
||||
SetActorZ(actor, actor->int_pos());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -4797,7 +4797,7 @@ int KillGet(DSWActor* actor)
|
|||
break;
|
||||
|
||||
auto actorNew = SpawnActor(STAT_ITEM, Red_COIN, s_RedCoin, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0, 0);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 0, 0);
|
||||
|
||||
actorNew->spr.shade = -20;
|
||||
actorNew->user.WaitTics = actor->user.WaitTics - 12;
|
||||
|
@ -4840,7 +4840,7 @@ int KillGetAmmo(DSWActor* actor)
|
|||
break;
|
||||
|
||||
auto actorNew = SpawnActor(STAT_ITEM, Red_COIN, s_RedCoin, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0, 0);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 0, 0);
|
||||
|
||||
actorNew->spr.shade = -20;
|
||||
actorNew->user.WaitTics = actor->user.WaitTics - 12;
|
||||
|
@ -4891,7 +4891,7 @@ int KillGetWeapon(DSWActor* actor)
|
|||
break;
|
||||
|
||||
auto actorNew = SpawnActor(STAT_ITEM, Red_COIN, s_RedCoin, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0, 0);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 0, 0);
|
||||
|
||||
actorNew->spr.shade = -20;
|
||||
actorNew->user.WaitTics = actor->user.WaitTics - 12;
|
||||
|
@ -4906,7 +4906,7 @@ int DoSpawnItemTeleporterEffect(DSWActor* actor)
|
|||
extern STATE s_TeleportEffect[];
|
||||
|
||||
auto effect = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - Z(12),
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - Z(12),
|
||||
actor->spr.ang, 0);
|
||||
|
||||
effect->spr.shade = -40;
|
||||
|
@ -5021,7 +5021,7 @@ int DoGet(DSWActor* actor)
|
|||
if (pp->Flags & (PF_DEAD))
|
||||
continue;
|
||||
|
||||
DISTANCE(pp->pos.X, pp->pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, a,b,c);
|
||||
DISTANCE(pp->pos.X, pp->pos.Y, actor->int_pos().X, actor->int_pos().Y, dist, a,b,c);
|
||||
if ((unsigned)dist > (plActor->user.Radius + actor->user.Radius))
|
||||
{
|
||||
continue;
|
||||
|
@ -5034,7 +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->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector(),
|
||||
can_see = FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(),
|
||||
pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector);
|
||||
actor->spr.cstat = cstat_bak;
|
||||
|
||||
|
@ -5824,10 +5824,10 @@ KeyMain:
|
|||
DSWActor* actorNew;
|
||||
if (actor->spr.hitag == TAG_NORESPAWN_FLAG)
|
||||
actorNew = SpawnActor(STAT_ITEM, ICON_FLAG, s_CarryFlagNoDet, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0, 0);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 0, 0);
|
||||
else
|
||||
actorNew = SpawnActor(STAT_ITEM, ICON_FLAG, s_CarryFlag, actor->sector(),
|
||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0, 0);
|
||||
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 0, 0);
|
||||
|
||||
actorNew->spr.shade = -20;
|
||||
|
||||
|
@ -5901,7 +5901,7 @@ void AdjustActiveRange(PLAYER* 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->sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorUpperZ(plActor), plActor->sector()))
|
||||
if (FAFcansee(actor->int_pos().X, actor->int_pos().Y, look_height, actor->sector(), plActor->int_pos().X, plActor->int_pos().Y, ActorUpperZ(plActor), plActor->sector()))
|
||||
{
|
||||
// Player is visible
|
||||
// adjust update range of this sprite
|
||||
|
@ -6056,7 +6056,7 @@ void SpriteControl(void)
|
|||
pp = &Player[pnum];
|
||||
|
||||
// Only update the ones closest
|
||||
DISTANCE(pp->pos.X, pp->pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, tx, ty, tmin);
|
||||
DISTANCE(pp->pos.X, pp->pos.Y, actor->int_pos().X, actor->int_pos().Y, dist, tx, ty, tmin);
|
||||
|
||||
AdjustActiveRange(pp, actor, dist);
|
||||
|
||||
|
@ -6218,7 +6218,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
|
|||
|
||||
ASSERT(actor->hasU());
|
||||
|
||||
vec3_t clippos = actor->spr.pos;
|
||||
vec3_t clippos = actor->int_pos();
|
||||
|
||||
// Can't modify sprite sectors
|
||||
// directly becuase of linked lists
|
||||
|
@ -6263,7 +6263,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
|
|||
// I subtracted 8 from the clipdist because actors kept going up on
|
||||
// ledges they were not supposed to go up on. Did the same for the
|
||||
// player. Seems to work ok!
|
||||
vec3_t pos = actor->spr.pos;
|
||||
vec3_t pos = actor->int_pos();
|
||||
pos.Z -= zh + 1;
|
||||
FAFgetzrange(pos, actor->sector(),
|
||||
&globhiz, &globhihit, &globloz, &globlohit,
|
||||
|
@ -6275,7 +6275,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
|
|||
// Takes info from global variables
|
||||
DoActorGlobZ(actor);
|
||||
|
||||
clippos.Z = actor->spr.pos.Z + ((zchange * numtics) >> 3);
|
||||
clippos.Z = actor->int_pos().Z + ((zchange * numtics) >> 3);
|
||||
|
||||
// test for hitting ceiling or floor
|
||||
if ((clippos.Z - zh <= globhiz) || (clippos.Z - zh > globloz))
|
||||
|
@ -6298,12 +6298,12 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
|
|||
|
||||
// extra processing for Stacks and warping
|
||||
if (FAF_ConnectArea(actor->sector()))
|
||||
SetActorZ(actor, actor->spr.pos);
|
||||
SetActorZ(actor, actor->int_pos());
|
||||
|
||||
if ((actor->sector()->extra & SECTFX_WARP_SECTOR))
|
||||
{
|
||||
DSWActor* sp_warp;
|
||||
pos = actor->spr.pos;
|
||||
pos = actor->int_pos();
|
||||
if ((sp_warp = WarpPlane(&pos.X, &pos.Y, &pos.Z, &dasect)))
|
||||
{
|
||||
actor->set_int_pos(pos);
|
||||
|
@ -6313,7 +6313,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
|
|||
|
||||
if (actor->sector() != lastsect)
|
||||
{
|
||||
pos = actor->spr.pos;
|
||||
pos = actor->int_pos();
|
||||
if ((sp_warp = Warp(&pos.X, &pos.Y, &pos.Z, &dasect)))
|
||||
{
|
||||
actor->set_int_pos(pos);
|
||||
|
@ -6397,7 +6397,7 @@ int MissileZrange(DSWActor* actor)
|
|||
auto tempshort = actor->spr.cstat;
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
||||
|
||||
FAFgetzrangepoint(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - 1, actor->sector(),
|
||||
FAFgetzrangepoint(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - 1, actor->sector(),
|
||||
&globhiz, &globhihit, &globloz, &globlohit);
|
||||
|
||||
actor->spr.cstat = tempshort;
|
||||
|
@ -6414,7 +6414,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
|
|||
|
||||
ASSERT(actor->hasU());
|
||||
|
||||
vec3_t clippos = actor->spr.pos;
|
||||
vec3_t clippos = actor->int_pos();
|
||||
|
||||
// Can't modify sprite sectors
|
||||
// directly becuase of linked lists
|
||||
|
@ -6452,7 +6452,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
|
|||
auto tempshort = actor->spr.cstat;
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
||||
|
||||
FAFgetzrangepoint(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - 1, actor->sector(),
|
||||
FAFgetzrangepoint(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - 1, actor->sector(),
|
||||
&globhiz, &globhihit, &globloz, &globlohit);
|
||||
|
||||
actor->spr.cstat = tempshort;
|
||||
|
@ -6463,7 +6463,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
|
|||
// missiles don't need the water to be down
|
||||
MissileWaterAdjust(actor);
|
||||
|
||||
clippos.Z = actor->spr.pos.Z + ((zchange * numtics) >> 3);
|
||||
clippos.Z = actor->int_pos().Z + ((zchange * numtics) >> 3);
|
||||
|
||||
// NOTE: this does not tell you when you hit a floor sprite
|
||||
// this case is currently treated like it hit a sector
|
||||
|
@ -6488,13 +6488,13 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
|
|||
}
|
||||
|
||||
if (FAF_ConnectArea(actor->sector()))
|
||||
SetActorZ(actor, actor->spr.pos);
|
||||
SetActorZ(actor, actor->int_pos());
|
||||
|
||||
if ((actor->sector()->extra & SECTFX_WARP_SECTOR))
|
||||
{
|
||||
DSWActor* sp_warp;
|
||||
|
||||
auto pos = actor->spr.pos;
|
||||
auto pos = actor->int_pos();
|
||||
if ((sp_warp = WarpPlane(&pos.X, &pos.Y, &pos.Z, &dasect)))
|
||||
{
|
||||
actor->set_int_pos(pos);
|
||||
|
@ -6504,7 +6504,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
|
|||
|
||||
if (actor->sector() != lastsect)
|
||||
{
|
||||
pos = actor->spr.pos;
|
||||
pos = actor->int_pos();
|
||||
if ((sp_warp = Warp(&pos.X, &pos.Y, &pos.Z, &dasect)))
|
||||
{
|
||||
actor->set_int_pos(pos);
|
||||
|
@ -6516,7 +6516,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
|
|||
|
||||
if (retval.type != kHitNone && (actor->sector()->ceilingstat & CSTAT_SECTOR_SKY))
|
||||
{
|
||||
if (actor->spr.pos.Z < actor->sector()->ceilingz)
|
||||
if (actor->int_pos().Z < actor->sector()->ceilingz)
|
||||
{
|
||||
retval.setVoid();
|
||||
}
|
||||
|
@ -6524,7 +6524,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
|
|||
|
||||
if (retval.type != kHitNone && (actor->sector()->floorstat & CSTAT_SECTOR_SKY))
|
||||
{
|
||||
if (actor->spr.pos.Z > actor->sector()->floorz)
|
||||
if (actor->int_pos().Z > actor->sector()->floorz)
|
||||
{
|
||||
retval.setVoid();
|
||||
}
|
||||
|
@ -6547,15 +6547,15 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
|
|||
auto dasect = actor->sector();
|
||||
auto lastsect = dasect;
|
||||
|
||||
vec3_t opos = actor->spr.pos;
|
||||
daz = actor->spr.pos.Z;
|
||||
vec3_t opos = actor->int_pos();
|
||||
daz = actor->int_pos().Z;
|
||||
|
||||
// climbing a wall
|
||||
if (actor->user.z_tgt)
|
||||
{
|
||||
if (labs(actor->user.z_tgt - actor->spr.pos.Z) > Z(40))
|
||||
if (labs(actor->user.z_tgt - actor->int_pos().Z) > Z(40))
|
||||
{
|
||||
if (actor->user.z_tgt > actor->spr.pos.Z)
|
||||
if (actor->user.z_tgt > actor->int_pos().Z)
|
||||
{
|
||||
actor->add_int_z(Z(30));
|
||||
return retval;
|
||||
|
@ -6572,14 +6572,14 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
|
|||
|
||||
actor->add_int_pos({ xchange / 2, ychange / 2, 0 });
|
||||
|
||||
updatesector(actor->spr.pos.X, actor->spr.pos.Y, &dasect);
|
||||
updatesector(actor->int_pos().X, actor->int_pos().Y, &dasect);
|
||||
|
||||
if (dasect == nullptr)
|
||||
{
|
||||
// back up and try again
|
||||
dasect = actor->sector();
|
||||
lastsect = dasect;
|
||||
opos = actor->spr.pos;
|
||||
opos = actor->int_pos();
|
||||
opos.Z = daz;
|
||||
clipmove(opos, &dasect,
|
||||
((xchange * numtics) << 11), ((ychange * numtics) << 11),
|
||||
|
@ -6605,13 +6605,13 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
|
|||
if ((dasect != actor->sector()) && (dasect != nullptr))
|
||||
{
|
||||
int new_loz,new_hiz;
|
||||
getzsofslopeptr(dasect, actor->spr.pos.X, actor->spr.pos.Y, &new_hiz, &new_loz);
|
||||
getzsofslopeptr(dasect, actor->int_pos().X, actor->int_pos().Y, &new_hiz, &new_loz);
|
||||
|
||||
actor->set_int_z(new_loz);
|
||||
ChangeActorSect(actor, dasect);
|
||||
}
|
||||
|
||||
getzsofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.hiz, &actor->user.loz);
|
||||
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &actor->user.hiz, &actor->user.loz);
|
||||
|
||||
actor->user.hi_sectp = actor->user.lo_sectp = actor->sector();
|
||||
actor->user.highActor = nullptr; actor->user.lowActor = nullptr;
|
||||
|
@ -6628,7 +6628,7 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
|
|||
{
|
||||
DSWActor* sp_warp;
|
||||
|
||||
auto pos = actor->spr.pos;
|
||||
auto pos = actor->int_pos();
|
||||
if ((sp_warp = WarpPlane(&pos.X, &pos.Y, &pos.Z, &dasect)))
|
||||
{
|
||||
actor->set_int_pos(pos);
|
||||
|
@ -6638,7 +6638,7 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
|
|||
|
||||
if (actor->sector() != lastsect)
|
||||
{
|
||||
pos = actor->spr.pos;
|
||||
pos = actor->int_pos();
|
||||
if ((sp_warp = Warp(&pos.X, &pos.Y, &pos.Z, &dasect)))
|
||||
{
|
||||
actor->set_int_pos(pos);
|
||||
|
|
|
@ -765,7 +765,7 @@ void BossHealthMeter(void)
|
|||
DSWActor* actor = BossSpriteNum[i];
|
||||
if (actor != nullptr && !bosswasseen[i])
|
||||
{
|
||||
if (cansee(actor->spr.pos.X, actor->spr.pos.Y, ActorZOfTop(actor), actor->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z - Z(40), pp->cursector))
|
||||
if (cansee(actor->int_pos().X, actor->int_pos().Y, ActorZOfTop(actor), actor->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z - Z(40), pp->cursector))
|
||||
{
|
||||
if (i == 0 && !bosswasseen[0])
|
||||
{
|
||||
|
|
|
@ -67,8 +67,8 @@ short TrackTowardPlayer(DSWActor* actor, TRACK* t, TRACK_POINT* start_point)
|
|||
end_point = t->TrackPoint;
|
||||
}
|
||||
|
||||
end_dist = Distance(end_point->x, end_point->y, actor->spr.pos.X, actor->spr.pos.Y);
|
||||
start_dist = Distance(start_point->x, start_point->y, actor->spr.pos.X, actor->spr.pos.Y);
|
||||
end_dist = Distance(end_point->x, end_point->y, actor->int_pos().X, actor->int_pos().Y);
|
||||
start_dist = Distance(start_point->x, start_point->y, actor->int_pos().X, actor->int_pos().Y);
|
||||
|
||||
if (end_dist < start_dist)
|
||||
{
|
||||
|
@ -94,8 +94,8 @@ short TrackStartCloserThanEnd(DSWActor* actor, TRACK* t, TRACK_POINT* start_poin
|
|||
end_point = t->TrackPoint;
|
||||
}
|
||||
|
||||
end_dist = Distance(end_point->x, end_point->y, actor->spr.pos.X, actor->spr.pos.Y);
|
||||
start_dist = Distance(start_point->x, start_point->y, actor->spr.pos.X, actor->spr.pos.Y);
|
||||
end_dist = Distance(end_point->x, end_point->y, actor->int_pos().X, actor->int_pos().Y);
|
||||
start_dist = Distance(start_point->x, start_point->y, actor->int_pos().X, actor->int_pos().Y);
|
||||
|
||||
if (start_dist < end_dist)
|
||||
{
|
||||
|
@ -196,13 +196,13 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr
|
|||
{
|
||||
tp = t->TrackPoint + end_point[i];
|
||||
|
||||
dist = Distance(tp->x, tp->y, actor->spr.pos.X, actor->spr.pos.Y);
|
||||
dist = Distance(tp->x, tp->y, actor->int_pos().X, actor->int_pos().Y);
|
||||
|
||||
if (dist < 15000 && dist < near_dist)
|
||||
{
|
||||
// make sure track start is on approximate z level - skip if
|
||||
// not
|
||||
if (labs(actor->spr.pos.Z - tp->z) > zdiff)
|
||||
if (labs(actor->int_pos().Z - tp->z) > zdiff)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr
|
|||
updatesector(near_tp->x, near_tp->y, &track_sect);
|
||||
|
||||
// if can see the point, return the track number
|
||||
if (track_sect && FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - Z(16), actor->sector(), near_tp->x, near_tp->y, track_sect->floorz - Z(32), track_sect))
|
||||
if (track_sect && FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - Z(16), actor->sector(), near_tp->x, near_tp->y, track_sect->floorz - Z(32), track_sect))
|
||||
{
|
||||
return short(near_track - &Track[0]);
|
||||
}
|
||||
|
@ -285,9 +285,9 @@ void TrackAddPoint(TRACK* t, TRACK_POINT* tp, DSWActor* actor)
|
|||
{
|
||||
TRACK_POINT* tpoint = (tp + t->NumPoints);
|
||||
|
||||
tpoint->x = actor->spr.pos.X;
|
||||
tpoint->y = actor->spr.pos.Y;
|
||||
tpoint->z = actor->spr.pos.Z;
|
||||
tpoint->x = actor->int_pos().X;
|
||||
tpoint->y = actor->int_pos().Y;
|
||||
tpoint->z = actor->int_pos().Z;
|
||||
tpoint->ang = actor->spr.ang;
|
||||
tpoint->tag_low = actor->spr.lotag;
|
||||
tpoint->tag_high = actor->spr.hitag;
|
||||
|
@ -303,7 +303,7 @@ DSWActor* TrackClonePoint(DSWActor* actor)
|
|||
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos(actor->spr.pos);
|
||||
actorNew->set_int_pos(actor->int_pos());
|
||||
actorNew->spr.ang = actor->spr.ang;
|
||||
actorNew->spr.lotag = actor->spr.lotag;
|
||||
actorNew->spr.hitag = actor->spr.hitag;
|
||||
|
@ -573,7 +573,7 @@ void TrackSetup(void)
|
|||
int i;
|
||||
it.Reset(STAT_TRACK + ndx);
|
||||
auto itActor = it.Next();
|
||||
Printf("WARNING: Did not find first point of Track Number %d, x %d, y %d\n", ndx, itActor->spr.pos.X, itActor->spr.pos.Y);
|
||||
Printf("WARNING: Did not find first point of Track Number %d, x %d, y %d\n", ndx, itActor->int_pos().X, itActor->int_pos().Y);
|
||||
it.Reset(STAT_TRACK + ndx);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
|
@ -598,7 +598,7 @@ void TrackSetup(void)
|
|||
it.Reset(STAT_TRACK + ndx);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
dist = Distance((tp + t->NumPoints - 1)->x, (tp + t->NumPoints - 1)->y, actor->spr.pos.X, actor->spr.pos.Y);
|
||||
dist = Distance((tp + t->NumPoints - 1)->x, (tp + t->NumPoints - 1)->y, actor->int_pos().X, actor->int_pos().Y);
|
||||
|
||||
if (dist < low_dist)
|
||||
{
|
||||
|
@ -683,8 +683,8 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
I_Error("SOP bound sprite with hitag %d not found", 500 + (int(sop - SectorObject) * 5));
|
||||
}
|
||||
|
||||
xlow = BoundActor->spr.pos.X;
|
||||
ylow = BoundActor->spr.pos.Y;
|
||||
xlow = BoundActor->int_pos().X;
|
||||
ylow = BoundActor->int_pos().Y;
|
||||
|
||||
KillActor(BoundActor);
|
||||
|
||||
|
@ -693,8 +693,8 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
{
|
||||
I_Error("SOP bound sprite with hitag %d not found", 501 + (int(sop - SectorObject) * 5));
|
||||
}
|
||||
xhigh = BoundActor->spr.pos.X;
|
||||
yhigh = BoundActor->spr.pos.Y;
|
||||
xhigh = BoundActor->int_pos().X;
|
||||
yhigh = BoundActor->int_pos().Y;
|
||||
|
||||
KillActor(BoundActor);
|
||||
|
||||
|
@ -707,9 +707,9 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
BoundActor = FindBoundSprite(SECT_SO_CENTER);
|
||||
if (BoundActor)
|
||||
{
|
||||
sop->pmid.X = BoundActor->spr.pos.X;
|
||||
sop->pmid.Y = BoundActor->spr.pos.Y;
|
||||
sop->pmid.Z = BoundActor->spr.pos.Z;
|
||||
sop->pmid.X = BoundActor->int_pos().X;
|
||||
sop->pmid.Y = BoundActor->int_pos().Y;
|
||||
sop->pmid.Z = BoundActor->int_pos().Z;
|
||||
KillActor(BoundActor);
|
||||
}
|
||||
|
||||
|
@ -817,7 +817,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
SWStatIterator it(StatList[i]);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
if (itActor->spr.pos.X > xlow && itActor->spr.pos.X < xhigh && itActor->spr.pos.Y > ylow && itActor->spr.pos.Y < yhigh)
|
||||
if (itActor->int_pos().X > xlow && itActor->int_pos().X < xhigh && itActor->int_pos().Y > ylow && itActor->int_pos().Y < yhigh)
|
||||
{
|
||||
// some delete sprites ride others don't
|
||||
if (itActor->spr.statnum == STAT_DELETE_SPRITE)
|
||||
|
@ -846,12 +846,12 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
short ang2;
|
||||
sop->clipdist = 0;
|
||||
sop->clipbox_dist[sop->clipbox_num] = itActor->spr.lotag;
|
||||
sop->clipbox_xoff[sop->clipbox_num] = sop->pmid.X - itActor->spr.pos.X;
|
||||
sop->clipbox_yoff[sop->clipbox_num] = sop->pmid.Y - itActor->spr.pos.Y;
|
||||
sop->clipbox_xoff[sop->clipbox_num] = sop->pmid.X - itActor->int_pos().X;
|
||||
sop->clipbox_yoff[sop->clipbox_num] = sop->pmid.Y - itActor->int_pos().Y;
|
||||
|
||||
sop->clipbox_vdist[sop->clipbox_num] = ksqrt(SQ(sop->pmid.X - itActor->spr.pos.X) + SQ(sop->pmid.Y - itActor->spr.pos.Y));
|
||||
sop->clipbox_vdist[sop->clipbox_num] = ksqrt(SQ(sop->pmid.X - itActor->int_pos().X) + SQ(sop->pmid.Y - itActor->int_pos().Y));
|
||||
|
||||
ang2 = getangle(itActor->spr.pos.X - sop->pmid.X, itActor->spr.pos.Y - sop->pmid.Y);
|
||||
ang2 = getangle(itActor->int_pos().X - sop->pmid.X, itActor->int_pos().Y - sop->pmid.Y);
|
||||
sop->clipbox_ang[sop->clipbox_num] = getincangle(ang2, sop->ang);
|
||||
|
||||
sop->clipbox_num++;
|
||||
|
@ -872,9 +872,9 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
}
|
||||
|
||||
|
||||
itActor->user.pos.X = sop->pmid.X - itActor->spr.pos.X;
|
||||
itActor->user.pos.Y = sop->pmid.Y - itActor->spr.pos.Y;
|
||||
itActor->user.pos.Z = sop->mid_sector->floorz - itActor->spr.pos.Z;
|
||||
itActor->user.pos.X = sop->pmid.X - itActor->int_pos().X;
|
||||
itActor->user.pos.Y = sop->pmid.Y - itActor->int_pos().Y;
|
||||
itActor->user.pos.Z = sop->mid_sector->floorz - itActor->int_pos().Z;
|
||||
|
||||
itActor->user.Flags |= (SPR_SO_ATTACHED);
|
||||
|
||||
|
@ -905,7 +905,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
if (sop->sectp[j] == itActor->sector())
|
||||
{
|
||||
itActor->user.Flags |= (SPR_ON_SO_SECTOR);
|
||||
itActor->user.pos.Z = itActor->sector()->floorz - itActor->spr.pos.Z;
|
||||
itActor->user.pos.Z = itActor->sector()->floorz - itActor->int_pos().Z;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -928,8 +928,8 @@ cont:
|
|||
{
|
||||
auto actor = sop->so_actors[i];
|
||||
|
||||
if (actor->spr.pos.Z > zmid)
|
||||
zmid = actor->spr.pos.Z;
|
||||
if (actor->int_pos().Z > zmid)
|
||||
zmid = actor->int_pos().Z;
|
||||
}
|
||||
|
||||
ASSERT(zmid != -9999999);
|
||||
|
@ -939,7 +939,7 @@ cont:
|
|||
for (i = 0; sop->so_actors[i] != nullptr; i++)
|
||||
{
|
||||
auto actor = sop->so_actors[i];
|
||||
actor->user.pos.Z = sop->pmid.Z - actor->spr.pos.Z;
|
||||
actor->user.pos.Z = sop->pmid.Z - actor->int_pos().Z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1201,7 +1201,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
|
|||
|
||||
if (TEST_BOOL4(actor))
|
||||
{
|
||||
sop->crush_z = actor->spr.pos.Z;
|
||||
sop->crush_z = actor->int_pos().Z;
|
||||
sop->flags |= (SOBJ_RECT_CLIP);
|
||||
}
|
||||
|
||||
|
@ -1475,7 +1475,7 @@ void PlaceActorsOnTracks(void)
|
|||
{
|
||||
tpoint = Track[actor->user.track].TrackPoint;
|
||||
|
||||
dist = Distance((tpoint + j)->x, (tpoint + j)->y, actor->spr.pos.X, actor->spr.pos.Y);
|
||||
dist = Distance((tpoint + j)->x, (tpoint + j)->y, actor->int_pos().X, actor->int_pos().Y);
|
||||
|
||||
if (dist < low_dist)
|
||||
{
|
||||
|
@ -1488,12 +1488,12 @@ void PlaceActorsOnTracks(void)
|
|||
|
||||
if (Track[actor->user.track].NumPoints == 0)
|
||||
{
|
||||
Printf("WARNING: Sprite %d (%d, %d) placed on track %d with no points!\n", actor->GetIndex(), actor->spr.pos.X, actor->spr.pos.Y, actor->user.track);
|
||||
Printf("WARNING: Sprite %d (%d, %d) placed on track %d with no points!\n", actor->GetIndex(), actor->int_pos().X, actor->int_pos().Y, actor->user.track);
|
||||
continue;
|
||||
}
|
||||
|
||||
// check angle in the "forward" direction
|
||||
actor->spr.ang = getangle((tpoint + actor->user.point)->x - actor->spr.pos.X, (tpoint + actor->user.point)->y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle((tpoint + actor->user.point)->x - actor->int_pos().X, (tpoint + actor->user.point)->y - actor->int_pos().Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1729,15 +1729,15 @@ PlayerPart:
|
|||
if ((actor->sector()->firstWall()->extra & WALLFX_LOOP_DONT_SPIN))
|
||||
continue;
|
||||
|
||||
auto pos = actor->spr.pos;
|
||||
auto pos = actor->int_pos();
|
||||
if ((actor->sector()->firstWall()->extra & WALLFX_LOOP_REVERSE_SPIN))
|
||||
{
|
||||
rotatepoint(sop->pmid.vec2, actor->spr.pos.vec2, -delta_ang, &pos.vec2);
|
||||
rotatepoint(sop->pmid.vec2, actor->int_pos().vec2, -delta_ang, &pos.vec2);
|
||||
actor->spr.ang = NORM_ANGLE(actor->spr.ang - delta_ang);
|
||||
}
|
||||
else
|
||||
{
|
||||
rotatepoint(sop->pmid.vec2, actor->spr.pos.vec2, delta_ang, &pos.vec2);
|
||||
rotatepoint(sop->pmid.vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
|
||||
actor->spr.ang = NORM_ANGLE(actor->spr.ang + delta_ang);
|
||||
}
|
||||
actor->set_int_pos(pos);
|
||||
|
@ -1748,8 +1748,8 @@ PlayerPart:
|
|||
if (!(sop->flags & SOBJ_DONT_ROTATE))
|
||||
{
|
||||
// NOT part of a sector - independant of any sector
|
||||
auto pos = actor->spr.pos;
|
||||
rotatepoint(sop->pmid.vec2, actor->spr.pos.vec2, delta_ang, &pos.vec2);
|
||||
auto pos = actor->int_pos();
|
||||
rotatepoint(sop->pmid.vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
|
||||
actor->spr.ang = NORM_ANGLE(actor->spr.ang + delta_ang);
|
||||
actor->set_int_pos(pos);
|
||||
}
|
||||
|
@ -1757,7 +1757,7 @@ PlayerPart:
|
|||
// Does not necessarily move with the sector so must accout for
|
||||
// moving across sectors
|
||||
if (sop->pmid.X < MAXSO) // special case for operating SO's
|
||||
SetActorZ(sop->so_actors[i], actor->spr.pos);
|
||||
SetActorZ(sop->so_actors[i], actor->int_pos());
|
||||
}
|
||||
|
||||
actor->user.oangdiff += getincangle(oldang, actor->spr.ang);
|
||||
|
@ -1928,7 +1928,7 @@ void UpdateSectorObjectSprites(SECTOR_OBJECT* sop)
|
|||
DSWActor* actor = sop->so_actors[i];
|
||||
if (!actor) continue;
|
||||
|
||||
SetActorZ(actor, actor->spr.pos);
|
||||
SetActorZ(actor, actor->int_pos());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2758,8 +2758,8 @@ void DoAutoTurretObject(SECTOR_OBJECT* 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->sector(),
|
||||
actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, ActorUpperZ(actor->user.targetActor), actor->user.targetActor->sector()))
|
||||
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, ActorUpperZ(actor->user.targetActor), actor->user.targetActor->sector()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -2793,7 +2793,7 @@ void DoAutoTurretObject(SECTOR_OBJECT* sop)
|
|||
}
|
||||
}
|
||||
|
||||
sop->ang_tgt = getangle(actor->user.targetActor->spr.pos.X - sop->pmid.X, actor->user.targetActor->spr.pos.Y - sop->pmid.Y);
|
||||
sop->ang_tgt = getangle(actor->user.targetActor->int_pos().X - sop->pmid.X, actor->user.targetActor->int_pos().Y - sop->pmid.Y);
|
||||
|
||||
// get delta to target angle
|
||||
delta_ang = getincangle(sop->ang, sop->ang_tgt);
|
||||
|
@ -2833,7 +2833,7 @@ void DoActorHitTrackEndPoint(DSWActor* actor)
|
|||
|
||||
if (actor->user.track >= 0)
|
||||
{
|
||||
actor->spr.ang = NORM_ANGLE(getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->spr.pos.X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->spr.pos.Y));
|
||||
actor->spr.ang = NORM_ANGLE(getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->int_pos().X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->int_pos().Y));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2849,7 +2849,7 @@ void DoActorHitTrackEndPoint(DSWActor* actor)
|
|||
|
||||
if (actor->user.track >= 0)
|
||||
{
|
||||
actor->spr.ang = NORM_ANGLE(getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->spr.pos.X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->spr.pos.Y));
|
||||
actor->spr.ang = NORM_ANGLE(getangle((Track[actor->user.track].TrackPoint + actor->user.point)->x - actor->int_pos().X, (Track[actor->user.track].TrackPoint + actor->user.point)->y - actor->int_pos().Y));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3005,7 +3005,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
{
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
||||
|
||||
FAFhitscan(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - Z(24), actor->sector(), // Start position
|
||||
FAFhitscan(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - Z(24), actor->sector(), // Start position
|
||||
bcos(actor->spr.ang), // X vector of 3D ang
|
||||
bsin(actor->spr.ang), // Y vector of 3D ang
|
||||
0, // Z vector of 3D ang
|
||||
|
@ -3024,7 +3024,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
if (!hit.hitWall->twoSided())
|
||||
return false;
|
||||
|
||||
zdiff = labs(actor->spr.pos.Z - hit.hitWall->nextSector()->floorz) >> 8;
|
||||
zdiff = labs(actor->int_pos().Z - hit.hitWall->nextSector()->floorz) >> 8;
|
||||
|
||||
actor->user.jump_speed = PickJumpSpeed(actor, zdiff);
|
||||
}
|
||||
|
@ -3103,12 +3103,12 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
|
||||
actor->spr.ang = tpoint->ang;
|
||||
|
||||
z[0] = actor->spr.pos.Z - ActorSizeZ(actor) + Z(5);
|
||||
z[1] = actor->spr.pos.Z - (ActorSizeZ(actor) >> 1);
|
||||
z[0] = actor->int_pos().Z - ActorSizeZ(actor) + Z(5);
|
||||
z[1] = actor->int_pos().Z - (ActorSizeZ(actor) >> 1);
|
||||
|
||||
for (i = 0; i < (int)SIZ(z); i++)
|
||||
{
|
||||
neartag({ actor->spr.pos.X, actor->spr.pos.Y, z[i] }, actor->sector(), actor->spr.ang, near, 1024, NTAG_SEARCH_LO_HI);
|
||||
neartag({ actor->int_pos().X, actor->int_pos().Y, z[i] }, actor->sector(), actor->spr.ang, near, 1024, NTAG_SEARCH_LO_HI);
|
||||
|
||||
if (near.actor() != nullptr && near.hitpos.X < 1024)
|
||||
{
|
||||
|
@ -3316,7 +3316,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
nx = MOVEx(100, lActor->spr.ang);
|
||||
ny = MOVEy(100, lActor->spr.ang);
|
||||
|
||||
actor->set_int_xy(lActor->spr.pos.X + nx, lActor->spr.pos.Y + ny);
|
||||
actor->set_int_xy(lActor->int_pos().X + nx, lActor->int_pos().Y + ny);
|
||||
|
||||
actor->spr.ang = NORM_ANGLE(lActor->spr.ang + 1024);
|
||||
|
||||
|
@ -3324,7 +3324,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
// Get the z height to climb
|
||||
//
|
||||
|
||||
neartag({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfTop(actor) - (ActorSizeZ(actor) >> 1) }, actor->sector(), actor->spr.ang, near, 600, NTAG_SEARCH_LO_HI);
|
||||
neartag({ actor->int_pos().X, actor->int_pos().Y, ActorZOfTop(actor) - (ActorSizeZ(actor) >> 1) }, actor->sector(), actor->spr.ang, near, 600, NTAG_SEARCH_LO_HI);
|
||||
|
||||
if (near.hitWall == nullptr)
|
||||
{
|
||||
|
@ -3356,7 +3356,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
bos_z = ActorZOfBottom(actor);
|
||||
if (bos_z > actor->user.loz)
|
||||
{
|
||||
actor->user.pos.Y = (bos_z - actor->spr.pos.Z);
|
||||
actor->user.pos.Y = (bos_z - actor->int_pos().Z);
|
||||
actor->add_int_z(-actor->user.pos.Y);
|
||||
}
|
||||
|
||||
|
@ -3412,7 +3412,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
|||
{
|
||||
pp = &Player[pnum];
|
||||
|
||||
if (Distance(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y) < actor->user.Dist)
|
||||
if (Distance(actor->int_pos().X, actor->int_pos().Y, pp->pos.X, pp->pos.Y) < actor->user.Dist)
|
||||
{
|
||||
actor->user.targetActor = pp->actor;
|
||||
actor->user.Flags &= ~(SPR_WAIT_FOR_PLAYER);
|
||||
|
@ -3443,10 +3443,10 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
|||
|
||||
if (!(actor->user.Flags & (SPR_CLIMBING | SPR_DONT_UPDATE_ANG)))
|
||||
{
|
||||
actor->spr.ang = getangle(tpoint->x - actor->spr.pos.X, tpoint->y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle(tpoint->x - actor->int_pos().X, tpoint->y - actor->int_pos().Y);
|
||||
}
|
||||
|
||||
if ((dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, tpoint->x, tpoint->y)) < 200) // 64
|
||||
if ((dist = Distance(actor->int_pos().X, actor->int_pos().Y, tpoint->x, tpoint->y)) < 200) // 64
|
||||
{
|
||||
if (!ActorTrackDecide(tpoint, actor))
|
||||
return true;
|
||||
|
@ -3458,7 +3458,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
|||
if (!(actor->user.Flags & (SPR_CLIMBING | SPR_DONT_UPDATE_ANG)))
|
||||
{
|
||||
// calculate a new angle to the target
|
||||
actor->spr.ang = getangle(tpoint->x - actor->spr.pos.X, tpoint->y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle(tpoint->x - actor->int_pos().X, tpoint->y - actor->int_pos().Y);
|
||||
}
|
||||
|
||||
if (actor->user.Flags & (SPR_ZDIFF_MODE))
|
||||
|
@ -3469,11 +3469,11 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
|||
dz = tpoint->z;
|
||||
|
||||
// find the distance to the target (player)
|
||||
dist = DIST(dx, dy, actor->spr.pos.X, actor->spr.pos.Y);
|
||||
dist = DIST(dx, dy, actor->int_pos().X, actor->int_pos().Y);
|
||||
|
||||
// (velocity * difference between the target and the object) /
|
||||
// distance
|
||||
actor->spr.zvel = -((actor->spr.xvel * (actor->spr.pos.Z - dz)) / dist);
|
||||
actor->spr.zvel = -((actor->spr.xvel * (actor->int_pos().Z - dz)) / dist);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3512,7 +3512,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
|||
|
||||
actor->spr.zvel = 0;
|
||||
|
||||
actor->spr.ang = getangle(tpoint->x - actor->spr.pos.X, tpoint->y - actor->spr.pos.Y);
|
||||
actor->spr.ang = getangle(tpoint->x - actor->int_pos().X, tpoint->y - actor->int_pos().Y);
|
||||
|
||||
ActorLeaveTrack(actor);
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
|
||||
|
|
|
@ -56,15 +56,15 @@ void ReverseVator(DSWActor* actor)
|
|||
// moving toward to OFF pos
|
||||
if (actor->user.z_tgt == actor->user.oz)
|
||||
{
|
||||
if (actor->spr.pos.Z == actor->user.oz)
|
||||
if (actor->int_pos().Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
else if (actor->user.pos.Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
}
|
||||
else if (actor->user.z_tgt == actor->user.pos.Z)
|
||||
{
|
||||
if (actor->spr.pos.Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
if (actor->int_pos().Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
else if (actor->user.pos.Z == actor->user.oz)
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ void SetVatorActive(DSWActor* actor)
|
|||
actor->user.Tics = 0;
|
||||
|
||||
// moving to the ON position
|
||||
if (actor->user.z_tgt == actor->spr.pos.Z)
|
||||
if (actor->user.z_tgt == actor->int_pos().Z)
|
||||
VatorSwitch(SP_TAG2(actor), true);
|
||||
else
|
||||
// moving to the OFF position
|
||||
|
@ -390,7 +390,7 @@ int DoVator(DSWActor* actor)
|
|||
if (*lptr == actor->user.z_tgt)
|
||||
{
|
||||
// in the ON position
|
||||
if (actor->user.z_tgt == actor->spr.pos.Z)
|
||||
if (actor->user.z_tgt == actor->int_pos().Z)
|
||||
{
|
||||
// change target
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
|
@ -411,7 +411,7 @@ int DoVator(DSWActor* actor)
|
|||
// change target
|
||||
actor->user.jump_speed = actor->user.vel_tgt;
|
||||
actor->user.vel_rate = short(abs(actor->user.vel_rate));
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
|
||||
RESET_BOOL8(actor);
|
||||
SetVatorInactive(actor);
|
||||
|
@ -541,7 +541,7 @@ int DoVatorAuto(DSWActor* actor)
|
|||
if (*lptr == actor->user.z_tgt)
|
||||
{
|
||||
// in the UP position
|
||||
if (actor->user.z_tgt == actor->spr.pos.Z)
|
||||
if (actor->user.z_tgt == actor->int_pos().Z)
|
||||
{
|
||||
// change target
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
|
@ -558,7 +558,7 @@ int DoVatorAuto(DSWActor* actor)
|
|||
// change target
|
||||
actor->user.jump_speed = actor->user.vel_tgt;
|
||||
actor->user.vel_rate = short(abs(actor->user.vel_rate));
|
||||
actor->user.z_tgt = actor->spr.pos.Z;
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
actor->user.Tics = actor->user.WaitTics;
|
||||
|
||||
if (SP_TAG6(actor) && TEST_BOOL5(actor))
|
||||
|
|
|
@ -96,16 +96,16 @@ void VisViewChange(PLAYER* pp, int *vis)
|
|||
auto own = GetOwner(actor);
|
||||
if (own != nullptr)
|
||||
{
|
||||
x = own->spr.pos.X;
|
||||
y = own->spr.pos.Y;
|
||||
z = own->spr.pos.Z;
|
||||
x = own->int_pos().X;
|
||||
y = own->int_pos().Y;
|
||||
z = own->int_pos().Z;
|
||||
sectp = own->sector();
|
||||
}
|
||||
else
|
||||
{
|
||||
x = actor->spr.pos.X;
|
||||
y = actor->spr.pos.Y;
|
||||
z = actor->spr.pos.Z;
|
||||
x = actor->int_pos().X;
|
||||
y = actor->int_pos().Y;
|
||||
z = actor->int_pos().Z;
|
||||
sectp = actor->sector();
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ void SpawnVis(DSWActor* parentActor, sectortype* sect, int x, int y, int z, int
|
|||
ASSERT(parentActor->hasU());
|
||||
parentActor->user.Flags2 |= (SPR2_CHILDREN);
|
||||
|
||||
actorNew->set_int_pos(parentActor->spr.pos);
|
||||
actorNew->set_int_pos(parentActor->int_pos());
|
||||
|
||||
parentActor->user.Flags2 |= (SPR2_VIS_SHADING);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ int DoWallMove(DSWActor* actor)
|
|||
|
||||
for(auto& wal : wall)
|
||||
{
|
||||
if (wal.wall_int_pos().X == actor->spr.pos.X && wal.wall_int_pos().Y == actor->spr.pos.Y)
|
||||
if (wal.wall_int_pos().X == actor->int_pos().X && wal.wall_int_pos().Y == actor->int_pos().Y)
|
||||
{
|
||||
found = true;
|
||||
|
||||
|
@ -115,7 +115,7 @@ int DoWallMove(DSWActor* actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
wal.movexy(actor->spr.pos.X + nx, actor->spr.pos.Y + ny);
|
||||
wal.movexy(actor->int_pos().X + nx, actor->int_pos().Y + ny);
|
||||
}
|
||||
|
||||
if (shade1)
|
||||
|
@ -166,7 +166,7 @@ bool CanSeeWallMove(DSWActor* caller, int match)
|
|||
{
|
||||
found = true;
|
||||
|
||||
if (cansee(caller->spr.pos.X, caller->spr.pos.Y, caller->spr.pos.Z, caller->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector()))
|
||||
if (cansee(caller->int_pos().X, caller->int_pos().Y, caller->int_pos().Z, caller->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ DSWActor* WarpPlane(int32_t* x, int32_t* y, int32_t* z, sectortype** sect)
|
|||
|
||||
if (sp_ceiling)
|
||||
{
|
||||
if (*z <= sp_ceiling->spr.pos.Z)
|
||||
if (*z <= sp_ceiling->int_pos().Z)
|
||||
{
|
||||
return WarpToArea(sp_ceiling, x, y, z, sect);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ DSWActor* WarpPlane(int32_t* x, int32_t* y, int32_t* z, sectortype** sect)
|
|||
|
||||
if (sp_floor)
|
||||
{
|
||||
if (*z >= sp_floor->spr.pos.Z)
|
||||
if (*z >= sp_floor->int_pos().Z)
|
||||
{
|
||||
return WarpToArea(sp_floor, x, y, z, sect);
|
||||
}
|
||||
|
@ -114,9 +114,9 @@ DSWActor* WarpToArea(DSWActor* sp_from, int32_t* x, int32_t* y, int32_t* z, sect
|
|||
short match_rand[16];
|
||||
int z_adj = 0;
|
||||
|
||||
xoff = *x - sp_from->spr.pos.X;
|
||||
yoff = *y - sp_from->spr.pos.Y;
|
||||
zoff = *z - sp_from->spr.pos.Z;
|
||||
xoff = *x - sp_from->int_pos().X;
|
||||
yoff = *y - sp_from->int_pos().Y;
|
||||
zoff = *z - sp_from->int_pos().Z;
|
||||
match = sp_from->spr.lotag;
|
||||
|
||||
#if 0
|
||||
|
@ -176,9 +176,9 @@ DSWActor* WarpToArea(DSWActor* sp_from, int32_t* x, int32_t* y, int32_t* z, sect
|
|||
return nullptr;
|
||||
|
||||
// determine new x,y,z position
|
||||
*x = actor->spr.pos.X + xoff;
|
||||
*y = actor->spr.pos.Y + yoff;
|
||||
*z = actor->spr.pos.Z + zoff;
|
||||
*x = actor->int_pos().X + xoff;
|
||||
*y = actor->int_pos().Y + yoff;
|
||||
*z = actor->int_pos().Z + zoff;
|
||||
|
||||
// make sure you warp outside of warp plane
|
||||
*z += z_adj;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -34,12 +34,12 @@ BEGIN_SW_NS
|
|||
|
||||
inline int AngToSprite(DSWActor* actor, DSWActor* other)
|
||||
{
|
||||
return (getangle(actor->spr.pos.X - other->spr.pos.X, actor->spr.pos.Y - other->spr.pos.Y));
|
||||
return (getangle(actor->int_pos().X - other->int_pos().X, actor->int_pos().Y - other->int_pos().Y));
|
||||
}
|
||||
|
||||
inline int AngToPlayer(PLAYER* player, DSWActor* other)
|
||||
{
|
||||
return (getangle(player->pos.X - other->spr.pos.X, player->pos.Y - other->spr.pos.Y));
|
||||
return (getangle(player->pos.X - other->int_pos().X, player->pos.Y - other->int_pos().Y));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -636,14 +636,14 @@ int NullZilla(DSWActor* actor)
|
|||
#if 0
|
||||
if (actor->user.State == s_ZillaDie)
|
||||
{
|
||||
getzsofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.y, &actor->user.hiz, &actor->user.loz);
|
||||
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->spr.y, &actor->user.hiz, &actor->user.loz);
|
||||
actor->user.lo_sectp = actor->sector();
|
||||
actor->user.hi_sectp = actor->sector();
|
||||
actor->spr.z = actor->user.loz;
|
||||
}
|
||||
#endif
|
||||
|
||||
getzsofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.hiz, &actor->user.loz);
|
||||
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &actor->user.hiz, &actor->user.loz);
|
||||
actor->user.lo_sectp = actor->sector();
|
||||
actor->user.hi_sectp = actor->sector();
|
||||
actor->user.lowActor = nullptr;
|
||||
|
@ -712,7 +712,7 @@ int DoZillaDeathMelt(DSWActor* actor)
|
|||
}
|
||||
|
||||
//KeepActorOnFloor(actor);
|
||||
getzsofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.hiz, &actor->user.loz);
|
||||
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &actor->user.hiz, &actor->user.loz);
|
||||
actor->user.lo_sectp = actor->sector();
|
||||
actor->user.hi_sectp = actor->sector();
|
||||
actor->user.lowActor = nullptr;
|
||||
|
|
|
@ -816,13 +816,13 @@ void SpawnZombie2(DSWActor* actor)
|
|||
if (FAF_ConnectArea(actor->sector()))
|
||||
{
|
||||
auto newsect = actor->sector();
|
||||
updatesectorz(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z + Z(10), &newsect);
|
||||
updatesectorz(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z + Z(10), &newsect);
|
||||
if (SectorIsUnderwaterArea(newsect))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 0);
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, 0);
|
||||
actorNew->user.Counter3 = 0;
|
||||
SetOwner(ownerActor, actorNew);
|
||||
actorNew->spr.pal = actorNew->user.spal = ownerActor->user.spal;
|
||||
|
|
Loading…
Reference in a new issue