slope functions with position vectors

This commit is contained in:
Christoph Oelckers 2022-08-23 22:24:01 +02:00
parent 0499be0c26
commit f269ceff64
19 changed files with 63 additions and 48 deletions

View file

@ -290,6 +290,23 @@ int getflorzofslopeptr(const sectortype* sec, int dax, int day);
void getzsofslopeptr(const sectortype* sec, int dax, int day, int* ceilz, int* florz); void getzsofslopeptr(const sectortype* sec, int dax, int day, int* ceilz, int* florz);
void getzsofslopeptr(const sectortype* sec, double dax, double day, double* ceilz, double* florz); void getzsofslopeptr(const sectortype* sec, double dax, double day, double* ceilz, double* florz);
inline int getceilzofslopeptr(const sectortype* sec, const DVector3& pos)
{
return getceilzofslopeptr(sec, pos.X * worldtoint, pos.Y * worldtoint);
}
inline int getflorzofslopeptr(const sectortype* sec, const DVector3& pos)
{
return getflorzofslopeptr(sec, pos.X * worldtoint, pos.Y * worldtoint);
}
inline void getzsofslopeptr(const sectortype* sec, const DVector3& pos, int* ceilz, int* florz)
{
getzsofslopeptr(sec, int(pos.X * worldtoint), int(pos.Y * worldtoint), ceilz, florz);
}
inline void getzsofslopeptr(const sectortype* sec, const DVector3& pos, double* ceilz, double* florz)
{
getzsofslopeptr(sec, pos.X, pos.Y, ceilz, florz);
}
inline double getceilzofslopeptrf(const sectortype* sec, double dax, double day) inline double getceilzofslopeptrf(const sectortype* sec, double dax, double day)
{ {
return getceilzofslopeptr(sec, dax * worldtoint, day * worldtoint) * zinttoworld; return getceilzofslopeptr(sec, dax * worldtoint, day * worldtoint) * zinttoworld;
@ -298,6 +315,10 @@ inline double getflorzofslopeptrf(const sectortype* sec, double dax, double day)
{ {
return getflorzofslopeptr(sec, dax * worldtoint, day * worldtoint) * zinttoworld; return getflorzofslopeptr(sec, dax * worldtoint, day * worldtoint) * zinttoworld;
} }
inline double getflorzofslopeptrf(const sectortype* sec, const DVector2& pos)
{
return getflorzofslopeptr(sec, pos.X * worldtoint, pos.Y * worldtoint) * zinttoworld;
}
enum EFindNextSector enum EFindNextSector

View file

@ -4882,7 +4882,7 @@ void MoveDude(DBloodActor* actor)
{ {
if (bUnderwater) if (bUnderwater)
{ {
int cz = getceilzofslopeptr(pSector, actor->int_pos().X, actor->int_pos().Y); int cz = getceilzofslopeptr(pSector, actor->spr.pos);
if (cz > top) if (cz > top)
vc += ((bottom - cz) * -80099) / (bottom - top); vc += ((bottom - cz) * -80099) / (bottom - top);
else else
@ -4890,7 +4890,7 @@ void MoveDude(DBloodActor* actor)
} }
else else
{ {
int fz = getflorzofslopeptr(pSector, actor->int_pos().X, actor->int_pos().Y); int fz = getflorzofslopeptr(pSector, actor->spr.pos);
if (fz < bottom) if (fz < bottom)
vc += ((bottom - fz) * -80099) / (bottom - top); vc += ((bottom - fz) * -80099) / (bottom - top);
} }
@ -5665,7 +5665,7 @@ static void actCheckThings()
{ {
int top, bottom; int top, bottom;
GetActorExtents(actor, &top, &bottom); GetActorExtents(actor, &top, &bottom);
if (getflorzofslopeptr(pSector, actor->int_pos().X, actor->int_pos().Y) <= bottom) if (getflorzofslopeptr(pSector, actor->spr.pos) <= bottom)
{ {
int angle = pXSector->panAngle; int angle = pXSector->panAngle;
int speed = 0; int speed = 0;
@ -6090,7 +6090,7 @@ static void actCheckDudes()
{ {
int top, bottom; int top, bottom;
GetActorExtents(actor, &top, &bottom); GetActorExtents(actor, &top, &bottom);
if (getflorzofslopeptr(pSector, actor->int_pos().X, actor->int_pos().Y) <= bottom) if (getflorzofslopeptr(pSector, actor->spr.pos) <= bottom)
{ {
int angle = pXSector->panAngle; int angle = pXSector->panAngle;
int speed = 0; int speed = 0;

View file

@ -287,7 +287,7 @@ static void batThinkChase(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{ {
aiSetTarget(actor, actor->GetTarget()); aiSetTarget(actor, actor->GetTarget());
int floorZ = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); int floorZ = getflorzofslopeptr(actor->sector(), actor->spr.pos);
if (height2 - height < 0x2000 && nDist < 0x200 && abs(nDeltaAngle) < 85) if (height2 - height < 0x2000 && nDist < 0x200 && abs(nDeltaAngle) < 85)
aiNewState(actor, &batBite); aiNewState(actor, &batBite);
else if ((height2 - height > 0x5000 || floorZ - bottom > 0x5000) && nDist < 0x1400 && nDist > 0x800 && abs(nDeltaAngle) < 85) else if ((height2 - height > 0x5000 || floorZ - bottom > 0x5000) && nDist < 0x1400 && nDist > 0x800 && abs(nDeltaAngle) < 85)

View file

@ -370,7 +370,7 @@ static void gargThinkChase(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{ {
aiSetTarget(actor, actor->GetTarget()); aiSetTarget(actor, actor->GetTarget());
int floorZ = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); int floorZ = getflorzofslopeptr(actor->sector(), actor->spr.pos);
switch (actor->spr.type) switch (actor->spr.type)
{ {
case kDudeGargoyleFlesh: case kDudeGargoyleFlesh:

View file

@ -349,7 +349,7 @@ static void ghostThinkChase(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{ {
aiSetTarget(actor, actor->GetTarget()); aiSetTarget(actor, actor->GetTarget());
int floorZ = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); int floorZ = getflorzofslopeptr(actor->sector(), actor->spr.pos);
switch (actor->spr.type) { switch (actor->spr.type) {
case kDudePhantasm: case kDudePhantasm:
if (nDist < 0x2000 && nDist > 0x1000 && abs(nDeltaAngle) < 85) { if (nDist < 0x2000 && nDist > 0x1000 && abs(nDeltaAngle) < 85) {

View file

@ -224,7 +224,7 @@ void CFX::fxProcess(void)
remove(actor); remove(actor);
continue; continue;
} }
if (getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y) <= actor->int_pos().Z) if (getflorzofslopeptr(actor->sector(), actor->spr.pos) <= actor->int_pos().Z)
{ {
if (pFXData->funcID < 0 || pFXData->funcID >= kCallbackMax) if (pFXData->funcID < 0 || pFXData->funcID >= kCallbackMax)
{ {
@ -243,7 +243,7 @@ void CFX::fxProcess(void)
if (actor->vel.X || actor->vel.Y || actor->vel.Z) if (actor->vel.X || actor->vel.Y || actor->vel.Z)
{ {
int32_t floorZ, ceilZ; int32_t floorZ, ceilZ;
getzsofslopeptr(pSector, actor->int_pos().X, actor->int_pos().Y, &ceilZ, &floorZ); getzsofslopeptr(pSector, actor->spr.pos, &ceilZ, &floorZ);
if (ceilZ > actor->int_pos().Z && !(pSector->ceilingstat & CSTAT_SECTOR_SKY)) if (ceilZ > actor->int_pos().Z && !(pSector->ceilingstat & CSTAT_SECTOR_SKY))
{ {
remove(actor); remove(actor);

View file

@ -1720,8 +1720,8 @@ void debrisMove(int listIndex)
if ((actor->xspr.physAttr & kPhysDebrisSwim) && uwater) if ((actor->xspr.physAttr & kPhysDebrisSwim) && uwater)
{ {
int vc = 0; int vc = 0;
int cz = getceilzofslopeptr(pSector, actor->int_pos().X, actor->int_pos().Y); int cz = getceilzofslopeptr(pSector, actor->spr.pos);
int fz = getflorzofslopeptr(pSector, actor->int_pos().X, actor->int_pos().Y); int fz = getflorzofslopeptr(pSector, actor->spr.pos);
int div = ClipLow(bottom - top, 1); int div = ClipLow(bottom - top, 1);
if (pSector->lowerLink) cz += (cz < 0) ? 0x500 : -0x500; if (pSector->lowerLink) cz += (cz < 0) ? 0x500 : -0x500;
@ -6687,12 +6687,12 @@ void sprite2sectorSlope(DBloodActor* actor, sectortype* pSector, char rel, bool
int slope = 0, z = 0; int slope = 0, z = 0;
switch (rel) { switch (rel) {
default: default:
z = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); z = getflorzofslopeptr(actor->sector(), actor->spr.pos);
if ((actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) && actor->hasX() && actor->xspr.Touch) z--; if ((actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) && actor->hasX() && actor->xspr.Touch) z--;
slope = pSector->floorheinum; slope = pSector->floorheinum;
break; break;
case 1: case 1:
z = getceilzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); z = getceilzofslopeptr(actor->sector(), actor->spr.pos);
if ((actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) && actor->hasX() && actor->xspr.Touch) z++; if ((actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) && actor->hasX() && actor->xspr.Touch) z++;
slope = pSector->ceilingheinum; slope = pSector->ceilingheinum;
break; break;
@ -9271,9 +9271,9 @@ void clampSprite(DBloodActor* actor, int which)
{ {
GetActorExtents(actor, &zTop, &zBot); GetActorExtents(actor, &zTop, &zBot);
if (which & 0x01) if (which & 0x01)
actor->add_int_z(ClipHigh(getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y) - zBot, 0)); actor->add_int_z(ClipHigh(getflorzofslopeptr(actor->sector(), actor->spr.pos) - zBot, 0));
if (which & 0x02) if (which & 0x02)
actor->add_int_z(ClipLow(getceilzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y) - zTop, 0)); actor->add_int_z(ClipLow(getceilzofslopeptr(actor->sector(), actor->spr.pos) - zTop, 0));
} }

View file

@ -1929,7 +1929,7 @@ void playerProcess(PLAYER* pPlayer)
auto link = actor->sector()->lowerLink; auto link = actor->sector()->lowerLink;
if (link && (link->spr.type == kMarkerLowGoo || link->spr.type == kMarkerLowWater)) if (link && (link->spr.type == kMarkerLowGoo || link->spr.type == kMarkerLowWater))
{ {
if (getceilzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y) > pPlayer->zView) if (getceilzofslopeptr(actor->sector(), actor->spr.pos) > pPlayer->zView)
pPlayer->isUnderwater = 0; pPlayer->isUnderwater = 0;
} }
} }

View file

@ -951,7 +951,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
{ {
int top, bottom; int top, bottom;
GetActorExtents(actor, &top, &bottom); GetActorExtents(actor, &top, &bottom);
int floorZ = getflorzofslopeptr(pSector, actor->int_pos().X, actor->int_pos().Y); int floorZ = getflorzofslopeptr(pSector, actor->spr.pos);
if (!(actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) && floorZ <= bottom) if (!(actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) && floorZ <= bottom)
{ {
viewBackupSpriteLoc(actor); viewBackupSpriteLoc(actor);

View file

@ -139,7 +139,7 @@ void warpInit(TArray<DBloodActor*>& actors)
actor->sector()->upperLink = actor; actor->sector()->upperLink = actor;
actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE; actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
actor->set_int_z(getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y)); actor->set_int_z(getflorzofslopeptr(actor->sector(), actor->spr.pos));
break; break;
case kMarkerLowWater: case kMarkerLowWater:
case kMarkerLowStack: case kMarkerLowStack:
@ -147,7 +147,7 @@ void warpInit(TArray<DBloodActor*>& actors)
actor->sector()->lowerLink = actor; actor->sector()->lowerLink = actor;
actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE; actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
actor->set_int_z(getceilzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y)); actor->set_int_z(getceilzofslopeptr(actor->sector(), actor->spr.pos));
break; break;
} }
} }
@ -204,7 +204,7 @@ int CheckLink(DBloodActor* actor)
if (aUpper->spr.type == kMarkerUpLink) if (aUpper->spr.type == kMarkerUpLink)
z = aUpper->int_pos().Z; z = aUpper->int_pos().Z;
else else
z = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); z = getflorzofslopeptr(actor->sector(), actor->spr.pos);
if (z <= actor->int_pos().Z) if (z <= actor->int_pos().Z)
{ {
aLower = aUpper->GetOwner(); aLower = aUpper->GetOwner();
@ -218,7 +218,7 @@ int CheckLink(DBloodActor* actor)
if (aLower->spr.type == kMarkerLowLink) if (aLower->spr.type == kMarkerLowLink)
z2 = aLower->int_pos().Z; z2 = aLower->int_pos().Z;
else else
z2 = getceilzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); z2 = getceilzofslopeptr(actor->sector(), actor->spr.pos);
add.Z = z2 - z; add.Z = z2 - z;
actor->add_int_pos(add); actor->add_int_pos(add);
actor->interpolated = false; actor->interpolated = false;
@ -231,7 +231,7 @@ int CheckLink(DBloodActor* actor)
if (aLower->spr.type == kMarkerLowLink) if (aLower->spr.type == kMarkerLowLink)
z = aLower->int_pos().Z; z = aLower->int_pos().Z;
else else
z = getceilzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); z = getceilzofslopeptr(actor->sector(), actor->spr.pos);
if (z >= actor->int_pos().Z) if (z >= actor->int_pos().Z)
{ {
aUpper = aLower->GetOwner(); aUpper = aLower->GetOwner();
@ -245,7 +245,7 @@ int CheckLink(DBloodActor* actor)
if (aUpper->spr.type == kMarkerUpLink) if (aUpper->spr.type == kMarkerUpLink)
z2 = aUpper->int_pos().Z; z2 = aUpper->int_pos().Z;
else else
z2 = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); z2 = getflorzofslopeptr(actor->sector(), actor->spr.pos);
add.Z = z2 - z; add.Z = z2 - z;
actor->add_int_pos(add); actor->add_int_pos(add);
actor->interpolated = false; actor->interpolated = false;

View file

@ -2139,7 +2139,7 @@ bool money(DDukeActor* actor, int BLOODPOOL)
deletesprite(actor); deletesprite(actor);
return false; return false;
} }
int l = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); int l = getflorzofslopeptr(actor->sector(), actor->spr.pos);
if (actor->int_pos().Z > l) if (actor->int_pos().Z > l)
{ {
@ -2201,8 +2201,8 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
return false; return false;
} }
int l = getflorzofslopeptr(sectp, actor->int_pos().X, actor->int_pos().Y); int l = getflorzofslopeptr(sectp, actor->spr.pos);
int x = getceilzofslopeptr(sectp, actor->int_pos().X, actor->int_pos().Y); int x = getceilzofslopeptr(sectp, actor->spr.pos);
if (x == l) if (x == l)
{ {
deletesprite(actor); deletesprite(actor);
@ -2269,7 +2269,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
} }
actor->temp_data[2]++; actor->temp_data[2]++;
} }
double ll = getflorzofslopeptrf(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y); double ll = getflorzofslopeptrf(actor->sector(), actor->spr.pos);
actor->spr.pos.Z = ll - 2; actor->spr.pos.Z = ll - 2;
actor->spr.xvel = 0; actor->spr.xvel = 0;
@ -2547,7 +2547,7 @@ void gutsdir(DDukeActor* actor, int gtype, int n, int p)
else sx = sy = 32; else sx = sy = 32;
int gutz = actor->int_pos().Z - (8 << 8); int gutz = actor->int_pos().Z - (8 << 8);
int floorz = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); int floorz = getflorzofslopeptr(actor->sector(), actor->spr.pos);
if (gutz > (floorz - (8 << 8))) if (gutz > (floorz - (8 << 8)))
gutz = floorz - (8 << 8); gutz = floorz - (8 << 8);

View file

@ -546,7 +546,7 @@ void guts_d(DDukeActor* actor, int gtype, int n, int p)
else sx = sy = 32; else sx = sy = 32;
gutz = actor->int_pos().Z - (8 << 8); gutz = actor->int_pos().Z - (8 << 8);
floorz = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); floorz = getflorzofslopeptr(actor->sector(), actor->spr.pos);
if (gutz > (floorz - (8 << 8))) if (gutz > (floorz - (8 << 8)))
gutz = floorz - (8 << 8); gutz = floorz - (8 << 8);

View file

@ -453,7 +453,7 @@ void guts_r(DDukeActor* actor, int gtype, int n, int p)
else sx = sy = 32; else sx = sy = 32;
gutz = actor->int_pos().Z - (8 << 8); gutz = actor->int_pos().Z - (8 << 8);
floorz = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y); floorz = getflorzofslopeptr(actor->sector(), actor->spr.pos);
if (gutz > (floorz - (8 << 8))) if (gutz > (floorz - (8 << 8)))
gutz = floorz - (8 << 8); gutz = floorz - (8 << 8);

View file

@ -358,7 +358,7 @@ int DoBloodSpray(DSWActor* actor)
// special stuff for blood worm // special stuff for blood worm
actor->add_int_z((actor->user.change.Z >> 1)); actor->add_int_z((actor->user.change.Z >> 1));
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &cz, &fz); getzsofslopeptr(actor->sector(), actor->spr.pos, &cz, &fz);
// pretend like we hit a sector // pretend like we hit a sector
if (actor->int_pos().Z >= fz) if (actor->int_pos().Z >= fz)
{ {
@ -715,8 +715,7 @@ int DoPhosphorus(DSWActor* actor)
if (!(actor->user.Flags & (SPR_BOUNCE | SPR_UNDERWATER)) && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) if (!(actor->user.Flags & (SPR_BOUNCE | SPR_UNDERWATER)) && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{ {
auto actorNew = SpawnActor(STAT_SKIP4, PUFF, s_PhosphorExp, actor->sector(), auto actorNew = SpawnActor(STAT_SKIP4, PUFF, s_PhosphorExp, actor->sector(), actor->spr.pos, actor->spr.angle, 100);
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->int_ang(), 100);
actorNew->spr.hitag = LUMINOUS; // Always full brightness actorNew->spr.hitag = LUMINOUS; // Always full brightness
SetOwner(actor, actorNew); SetOwner(actor, actorNew);

View file

@ -1325,9 +1325,7 @@ void DoSpawnTeleporterEffectPlace(DSWActor* actor)
{ {
extern STATE s_TeleportEffect[]; extern STATE s_TeleportEffect[];
auto effectActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), auto effectActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), ActorVectOfTop(actor).plusZ(16), actor->spr.angle, 0);
actor->int_pos().X, actor->int_pos().Y, int_ActorZOfTop(actor) + Z(16),
actor->int_ang(), 0);
SetActorZ(effectActor, effectActor->spr.pos); SetActorZ(effectActor, effectActor->spr.pos);

View file

@ -258,7 +258,7 @@ void MoveSpritesWithSpike(sectortype* sect)
if ((actor->spr.extra & SPRX_STAY_PUT_VATOR)) if ((actor->spr.extra & SPRX_STAY_PUT_VATOR))
continue; continue;
getzsofslopeptr(sect, actor->int_pos().X, actor->int_pos().Y, &cz, &fz); getzsofslopeptr(sect, actor->spr.pos, &cz, &fz);
actor->set_int_z(fz); actor->set_int_z(fz);
} }
} }

View file

@ -1558,7 +1558,7 @@ void SpriteSetup(void)
while (auto actor = it.Next()) while (auto actor = it.Next())
{ {
// not used yetv // not used yetv
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &cz, &fz); getzsofslopeptr(actor->sector(), actor->spr.pos, &cz, &fz);
if (actor->int_pos().Z > ((cz + fz) >> 1)) if (actor->int_pos().Z > ((cz + fz) >> 1))
{ {
// closer to a floor // closer to a floor
@ -6590,14 +6590,11 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
actor->user.z_tgt = 0; actor->user.z_tgt = 0;
if ((dasect != actor->sector()) && (dasect != nullptr)) if ((dasect != actor->sector()) && (dasect != nullptr))
{ {
int new_loz,new_hiz; actor->spr.pos.Z = getflorzofslopeptrf(dasect, actor->spr.pos.X, actor->spr.pos.Y);
getzsofslopeptr(dasect, actor->int_pos().X, actor->int_pos().Y, &new_hiz, &new_loz);
actor->set_int_z(new_loz);
ChangeActorSect(actor, dasect); ChangeActorSect(actor, dasect);
} }
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &actor->user.hiz, &actor->user.loz); getzsofslopeptr(actor->sector(), actor->spr.pos, &actor->user.hiz, &actor->user.loz);
actor->user.hi_sectp = actor->user.lo_sectp = actor->sector(); actor->user.hi_sectp = actor->user.lo_sectp = actor->sector();
actor->user.highActor = nullptr; actor->user.lowActor = nullptr; actor->user.highActor = nullptr; actor->user.lowActor = nullptr;

View file

@ -8139,7 +8139,7 @@ bool SlopeBounce(DSWActor* actor, bool *hit_wall)
auto hit_sector = actor->user.coll.hitSector; auto hit_sector = actor->user.coll.hitSector;
getzsofslopeptr(hit_sector, actor->int_pos().X, actor->int_pos().Y, &hiz, &loz); getzsofslopeptr(hit_sector, actor->spr.pos, &hiz, &loz);
// detect the ceiling and the hit_wall // detect the ceiling and the hit_wall
if (actor->int_pos().Z < ((hiz+loz) >> 1)) if (actor->int_pos().Z < ((hiz+loz) >> 1))
@ -11166,7 +11166,7 @@ int DoRing(DSWActor* actor)
ASSERT(actor->insector()); ASSERT(actor->insector());
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &cz, &fz); getzsofslopeptr(actor->sector(), actor->spr.pos, &cz, &fz);
// bound the sprite by the sectors ceiling and floor // bound the sprite by the sectors ceiling and floor
if (actor->int_pos().Z > fz) if (actor->int_pos().Z > fz)
@ -11292,7 +11292,7 @@ int DoSerpRing(DSWActor* actor)
ASSERT(actor->insector()); ASSERT(actor->insector());
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &cz, &fz); getzsofslopeptr(actor->sector(), actor->spr.pos, &cz, &fz);
// bound the sprite by the sectors ceiling and floor // bound the sprite by the sectors ceiling and floor
if (actor->int_pos().Z > fz) if (actor->int_pos().Z > fz)

View file

@ -633,7 +633,7 @@ int SetupZilla(DSWActor* actor)
int NullZilla(DSWActor* actor) int NullZilla(DSWActor* actor)
{ {
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &actor->user.hiz, &actor->user.loz); getzsofslopeptr(actor->sector(), actor->spr.pos, &actor->user.hiz, &actor->user.loz);
actor->user.lo_sectp = actor->sector(); actor->user.lo_sectp = actor->sector();
actor->user.hi_sectp = actor->sector(); actor->user.hi_sectp = actor->sector();
actor->user.lowActor = nullptr; actor->user.lowActor = nullptr;
@ -702,7 +702,7 @@ int DoZillaDeathMelt(DSWActor* actor)
} }
//KeepActorOnFloor(actor); //KeepActorOnFloor(actor);
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y, &actor->user.hiz, &actor->user.loz); getzsofslopeptr(actor->sector(), actor->spr.pos, &actor->user.hiz, &actor->user.loz);
actor->user.lo_sectp = actor->sector(); actor->user.lo_sectp = actor->sector();
actor->user.hi_sectp = actor->sector(); actor->user.hi_sectp = actor->sector();
actor->user.lowActor = nullptr; actor->user.lowActor = nullptr;