- rename GetActorHeightF

(no edits here, just one replace.)
This commit is contained in:
Christoph Oelckers 2022-09-10 21:24:40 +02:00
parent c65c317665
commit b5c315978c
16 changed files with 35 additions and 35 deletions

View file

@ -214,7 +214,7 @@ DExhumedActor* UpdateEnemy(DExhumedActor** ppEnemy);
Collision MoveCreature(DExhumedActor* nSprite);
Collision MoveCreatureWithCaution(DExhumedActor* actor);
DVector3 WheresMyMouth(int nPlayer, sectortype** sectnum);
double GetActorHeightF(DExhumedActor* nSprite);
double GetActorHeight(DExhumedActor* nSprite);
DExhumedActor* insertActor(sectortype* s, int st);
DExhumedActor* GrabBody();
DExhumedActor* GrabBodyGunSprite();

View file

@ -207,8 +207,8 @@ void AIAnubis::Tick(RunListEvent* ev)
if (pTarget != nullptr) // NOTE: nTarget can be -1. this check wasn't in original code. TODO: demo compatiblity?
{
if (cansee(ap->spr.pos.plusZ(-GetActorHeightF(ap)), ap->sector(),
pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector()))
if (cansee(ap->spr.pos.plusZ(-GetActorHeight(ap)), ap->sector(),
pTarget->spr.pos.plusZ(-GetActorHeight(pTarget)), pTarget->sector()))
{
ap->vel.X = 0;
ap->vel.Y = 0;

View file

@ -398,7 +398,7 @@ MOVEEND:
if (BulletList[nBullet].pEnemy)
{
hitactor = BulletList[nBullet].pEnemy;
pos = hitactor->spr.pos.plusZ(-GetActorHeightF(hitactor) * 0.5);
pos = hitactor->spr.pos.plusZ(-GetActorHeight(hitactor) * 0.5);
pHitSect = hitactor->sector();
}
else
@ -535,7 +535,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA
sBullet.pActor = insertActor(pActor->sector(), 200);
sBullet.pActor->spr.angle = nAngle;
double nHeight = GetActorHeightF(pTarget);
double nHeight = GetActorHeight(pTarget);
assert(pTarget->sector());
@ -567,7 +567,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA
}
auto pBulletActor = insertActor(pSector, 200);
double fHeight = GetActorHeightF(pActor) * 0.75;
double fHeight = GetActorHeight(pActor) * 0.75;
if (fZOffset == INT_MAX) {
fZOffset = -fHeight;
@ -674,7 +674,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA
}
else
{
fHeight = GetActorHeightF(pTarget);
fHeight = GetActorHeight(pTarget);
if (pTarget->spr.statnum == 100)
{

View file

@ -367,7 +367,7 @@ void AIFish::Tick(RunListEvent* ev)
else
{
PlotCourseToSprite(pActor, pTargetActor);
double nHeight = GetActorHeightF(pActor) * 0.5;
double nHeight = GetActorHeight(pActor) * 0.5;
double z = fabs(pTargetActor->spr.pos.Z - pActor->spr.pos.Z);
if (z <= nHeight)

View file

@ -651,7 +651,7 @@ loc_flag:
ebx += angle.Sin() * (1 << 3) * ecx;
}
double nHeight = GetActorHeightF(pPlayerActor) * -0.5;
double nHeight = GetActorHeight(pPlayerActor) * -0.5;
if (nAction < 6)
{

View file

@ -380,7 +380,7 @@ void AILion::Tick(RunListEvent* ev)
{
HitInfo hit{};
hitscan(pActor->spr.pos.plusZ(-GetActorHeightF(pActor) * 0.5), pActor->sector(), DVector3(nScanAngle.ToVector() * 1024, 0), hit, CLIPMASK1);
hitscan(pActor->spr.pos.plusZ(-GetActorHeight(pActor) * 0.5), pActor->sector(), DVector3(nScanAngle.ToVector() * 1024, 0), hit, CLIPMASK1);
if (hit.hitWall)
{

View file

@ -382,7 +382,7 @@ Collision movespritez(DExhumedActor* pActor, double z, double height, int clipdi
return nRet;
}
double GetActorHeightF(DExhumedActor* actor)
double GetActorHeight(DExhumedActor* actor)
{
return tileHeight(actor->spr.picnum) * actor->spr.yrepeat * REPEAT_SCALE;
}
@ -400,7 +400,7 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist
bTouchFloor = false;
auto spos = pActor->spr.pos;
double nSpriteHeight = GetActorHeightF(pActor);
double nSpriteHeight = GetActorHeight(pActor);
int nClipDist = pActor->int_clipdist();
auto pSector = pActor->sector();
assert(pSector);
@ -592,7 +592,7 @@ DExhumedActor* FindPlayer(DExhumedActor* pActor, int nDistance, bool dontengage)
{
int v10 = abs(pPlayerActor->spr.pos.Y - pActor->spr.pos.Y);
if (v10 < nDistance && cansee(pPlayerActor->spr.pos.plusZ(-30), pPlayerActor->sector(), pActor->spr.pos.plusZ(-GetActorHeightF(pActor)), pSector))
if (v10 < nDistance && cansee(pPlayerActor->spr.pos.plusZ(-30), pPlayerActor->sector(), pActor->spr.pos.plusZ(-GetActorHeight(pActor)), pSector))
{
break;
}
@ -913,7 +913,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol
}
else
{
double nHeight = GetActorHeightF(pActor2) / 2;
double nHeight = GetActorHeight(pActor2) / 2;
auto vect = pActor2->spr.pos.XY() - pActor->spr.pos.XY();
DAngle nMyAngle = VecToAngle(vect);
double nSqrt = vect.Length();
@ -957,7 +957,7 @@ DAngle GetWallNormal(walltype* pWall)
DVector3 WheresMyMouth(int nPlayer, sectortype **sectnum)
{
auto pActor = PlayerList[nPlayer].pActor;
double height = GetActorHeightF(pActor) * 0.5;
double height = GetActorHeight(pActor) * 0.5;
*sectnum = pActor->sector();
auto pos = pActor->spr.pos.plusZ(-height);

View file

@ -200,8 +200,8 @@ void AIMummy::Tick(RunListEvent* ev)
{
if (RandomBit() && pTarget)
{
if (cansee(pActor->spr.pos.plusZ(-GetActorHeightF(pActor)), pActor->sector(),
pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector()))
if (cansee(pActor->spr.pos.plusZ(-GetActorHeight(pActor)), pActor->sector(),
pTarget->spr.pos.plusZ(-GetActorHeight(pTarget)), pTarget->sector()))
{
pActor->nAction = 3;
pActor->nFrame = 0;

View file

@ -565,7 +565,7 @@ int CheckSectorSprites(sectortype* pSector, int nVal)
ExhumedSectIterator it(pSector);
while (auto pActor= it.Next())
{
if ((pActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) && (nZDiff < GetActorHeightF(pActor)))
if ((pActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) && (nZDiff < GetActorHeight(pActor)))
{
if (nVal != 1) {
return 1;
@ -1776,7 +1776,7 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag)
// in-game destructable wall mounted screen
void ExplodeScreen(DExhumedActor* pActor)
{
pActor->spr.pos.Z -= GetActorHeightF(pActor) * 0.5;
pActor->spr.pos.Z -= GetActorHeight(pActor) * 0.5;
for (int i = 0; i < 30; i++) {
BuildSpark(pActor, 0); // shoot out blue orbs

View file

@ -293,7 +293,7 @@ void RestartPlayer(int nPlayer)
pActor->vel.Y = 0;
pActor->vel.Z = 0;
nStandHeight = GetActorHeightF(pActor);
nStandHeight = GetActorHeight(pActor);
pActor->spr.hitag = 0;
pActor->spr.extra = -1;

View file

@ -294,7 +294,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int thr
{
auto vect = pActor2->spr.pos.XY() - pActor->spr.pos.XY();
double nTileY = GetActorHeightF(pActor2) / 2;
double nTileY = GetActorHeight(pActor2) / 2;
double edx = ((pActor2->spr.pos.Z - nTileY) - pActor->spr.pos.Z);
double nSqrt = vect.Length();
@ -349,7 +349,7 @@ int DestroyTailPart()
for (int i = 0; i < 5; i++)
{
double nHeight = GetActorHeightF(pActor);
double nHeight = GetActorHeight(pActor);
BuildLavaLimb(pActor, i, nHeight);
}
@ -945,7 +945,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
if (QueenHead.nIndex2 < 10) {
for (int i = (10 - QueenHead.nIndex2) * 2; i > 0; i--)
{
BuildLavaLimb(pActor, i, GetActorHeightF(pActor));
BuildLavaLimb(pActor, i, GetActorHeight(pActor));
}
}
}
@ -963,7 +963,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
for (i = 0; i < 20; i++)
{
BuildLavaLimb(pActor, i, GetActorHeightF(pActor));
BuildLavaLimb(pActor, i, GetActorHeight(pActor));
}
runlist_SubRunRec(pActor->spr.intowner);

View file

@ -163,7 +163,7 @@ void MoveRaToEnemy(int nPlayer)
pTarget = PlayerList[nPlayer].pActor;
}
pActor->spr.pos = pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget));
pActor->spr.pos = pTarget->spr.pos.plusZ(-GetActorHeight(pTarget));
if (pActor->sector() != pTarget->sector()) {
ChangeActorSect(pActor, pTarget->sector());

View file

@ -419,8 +419,8 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode)
{
pActor->nCount = 45;
if (cansee(pActor->spr.pos.plusZ(-GetActorHeightF(pActor)), pActor->sector(),
pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector()))
if (cansee(pActor->spr.pos.plusZ(-GetActorHeight(pActor)), pActor->sector(),
pTarget->spr.pos.plusZ(-GetActorHeight(pTarget)), pTarget->sector()))
{
pActor->vel.X = 0;
pActor->vel.Y = 0;

View file

@ -108,7 +108,7 @@ void BuildSoul(DExhumedActor* pSet)
pActor->vel.X = 0;
pActor->vel.Y = 0;
pActor->vel.Z = -1 - RandomSize(10) / 256.;
pActor->spr.pos = DVector3(pSet->spr.pos.XY(), RandomSize(8) + 32 + pActor->sector()->ceilingz - GetActorHeightF(pActor));
pActor->spr.pos = DVector3(pSet->spr.pos.XY(), RandomSize(8) + 32 + pActor->sector()->ceilingz - GetActorHeight(pActor));
//pActor->spr.hitag = nSet;
pActor->pTarget = pSet;
@ -149,7 +149,7 @@ void AISoul::Tick(RunListEvent* ev)
pActor->spr.cstat = 0;
pActor->spr.yrepeat = 1;
pActor->spr.xrepeat = 1;
pActor->spr.pos = pSet->spr.pos.plusZ(-GetActorHeightF(pSet) * 0.5);
pActor->spr.pos = pSet->spr.pos.plusZ(-GetActorHeight(pSet) * 0.5);
ChangeActorSect(pActor, pSet->sector());
return;
}
@ -566,9 +566,9 @@ void AISet::Tick(RunListEvent* ev)
{
if (nFlag & 0x80)
{
pActor->spr.pos.Z -= GetActorHeightF(pActor);
pActor->spr.pos.Z -= GetActorHeight(pActor);
BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqSet, 76, 0));
pActor->spr.pos.Z += GetActorHeightF(pActor);
pActor->spr.pos.Z += GetActorHeight(pActor);
}
if (bVal)

View file

@ -98,7 +98,7 @@ void AISpider::Tick(RunListEvent* ev)
{
if (spp->spr.cstat & CSTAT_SPRITE_YFLIP)
{
spp->spr.pos.Z = spp->sector()->ceilingz + GetActorHeightF(spp);
spp->spr.pos.Z = spp->sector()->ceilingz + GetActorHeight(spp);
}
else
{
@ -206,7 +206,7 @@ void AISpider::Tick(RunListEvent* ev)
{
spp->spr.cstat ^= CSTAT_SPRITE_YFLIP;
spp->vel.Z = 1./256.;
spp->spr.pos.Z = spp->sector()->ceilingz+ GetActorHeightF(spp);
spp->spr.pos.Z = spp->sector()->ceilingz+ GetActorHeight(spp);
}
else
{
@ -284,7 +284,7 @@ void AISpider::Tick(RunListEvent* ev)
&& !((spp->sector()->ceilingstat) & CSTAT_SECTOR_SKY))
{
spp->spr.cstat |= CSTAT_SPRITE_YFLIP;
spp->spr.pos.Z = spp->sector()->ceilingz + GetActorHeightF(spp);
spp->spr.pos.Z = spp->sector()->ceilingz + GetActorHeight(spp);
spp->vel.Z = 0;
spp->nAction = 1;

View file

@ -151,7 +151,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& view, double
{
nCreepyTimer = kCreepyCount;
if (!cansee(view, pSector, targ->spr.pos.plusZ(-GetActorHeightF(targ)), targ->sector()))
if (!cansee(view, pSector, targ->spr.pos.plusZ(-GetActorHeight(targ)), targ->sector()))
{
bestTarget = nullptr;
}