diff --git a/source/core/coreactor.h b/source/core/coreactor.h index 659575de0..ac8c1d862 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -178,6 +178,37 @@ public: spr.xint = int(spr.xint * v); } + // Only used this way by Exhumed. + int int_yvel() const + { + return spr.yint; + } + + double float_yvel() const + { + return spr.yint * inttoworld; + } + + void clear_yvel() + { + spr.yint = 0; + } + + void set_int_yvel(int v) + { + spr.yint = v; + } + + void add_int_yvel(int v) + { + spr.yint += v; + } + + void mul_int_yvel(double v) + { + spr.yint = int(spr.yint * v); + } + // Same as above but with inverted y and z axes to match the renderer's coordinate system. double interpolatedx(double const smoothratio, int const scale = 16) diff --git a/source/games/exhumed/src/anims.cpp b/source/games/exhumed/src/anims.cpp index c3237e90f..3211f9028 100644 --- a/source/games/exhumed/src/anims.cpp +++ b/source/games/exhumed/src/anims.cpp @@ -87,7 +87,7 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->backuppos(); diff --git a/source/games/exhumed/src/anubis.cpp b/source/games/exhumed/src/anubis.cpp index 58bf6a12a..468662bec 100644 --- a/source/games/exhumed/src/anubis.cpp +++ b/source/games/exhumed/src/anubis.cpp @@ -69,7 +69,7 @@ void BuildAnubis(DExhumedActor* ap, const DVector3& pos, sectortype* pSector, in ap->spr.xrepeat = 40; ap->spr.yrepeat = 40; ap->clear_xvel(); - ap->spr.yvel = 0; + ap->clear_yvel(); ap->clear_zvel(); ap->spr.hitag = 0; ap->spr.lotag = runlist_HeadRun() + 1; @@ -215,7 +215,7 @@ void AIAnubis::Tick(RunListEvent* ev) pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector())) { ap->clear_xvel(); - ap->spr.yvel = 0; + ap->clear_yvel(); ap->spr.angle = VecToAngle(pTarget->spr.pos - ap->spr.pos); ap->nAction = 3; @@ -277,7 +277,7 @@ void AIAnubis::Tick(RunListEvent* ev) case 5: { ap->clear_xvel(); - ap->spr.yvel = 0; + ap->clear_yvel(); if (bVal) { @@ -308,7 +308,7 @@ void AIAnubis::Tick(RunListEvent* ev) ap->nFrame = 0; ap->clear_xvel(); - ap->spr.yvel = 0; + ap->clear_yvel(); } return; } @@ -334,7 +334,7 @@ void AIAnubis::Tick(RunListEvent* ev) ap->pTarget = nullptr; ap->clear_xvel(); - ap->spr.yvel = 0; + ap->clear_yvel(); } } } @@ -414,7 +414,7 @@ void AIAnubis::Damage(RunListEvent* ev) { // he ded. ap->clear_xvel(); - ap->spr.yvel = 0; + ap->clear_yvel(); ap->clear_zvel(); ap->spr.pos.Z = ap->sector()->floorz; ap->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; diff --git a/source/games/exhumed/src/bubbles.cpp b/source/games/exhumed/src/bubbles.cpp index b0dfaa8fb..f96ea3d4b 100644 --- a/source/games/exhumed/src/bubbles.cpp +++ b/source/games/exhumed/src/bubbles.cpp @@ -54,7 +54,7 @@ DExhumedActor* BuildBubble(const DVector3& pos, sectortype* pSector) pActor->spr.picnum = 1; pActor->set_int_ang(inita); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->set_int_zvel(-1200); pActor->spr.hitag = -1; pActor->spr.extra = -1; diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 7f5209c2a..795dfac28 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -619,7 +619,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n pBulletActor->spr.yoffset = 0; pBulletActor->set_int_ang(nAngle); pBulletActor->clear_xvel(); - pBulletActor->spr.yvel = 0; + pBulletActor->clear_yvel(); pBulletActor->clear_zvel(); pBulletActor->spr.lotag = runlist_HeadRun() + 1; pBulletActor->spr.extra = -1; diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index d640fbdbf..a69ca5501 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -123,7 +123,7 @@ void AIFishLimb::Tick(RunListEvent* ev) if (coll.type != kHitNone) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } @@ -161,7 +161,7 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.yoffset = 0; pActor->spr.picnum = seq_GetSeqPicnum(kSeqFish, FishSeq[0].a, 0); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->set_int_ang(nAngle); pActor->spr.lotag = runlist_HeadRun() + 1; @@ -379,7 +379,7 @@ void AIFish::Tick(RunListEvent* ev) else { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } pActor->set_int_zvel(int((pTargetActor->spr.pos.Z - pActor->spr.pos.Z) * zworldtoint / 8)); diff --git a/source/games/exhumed/src/grenade.cpp b/source/games/exhumed/src/grenade.cpp index 627861f68..4d11161d0 100644 --- a/source/games/exhumed/src/grenade.cpp +++ b/source/games/exhumed/src/grenade.cpp @@ -115,7 +115,7 @@ void BuildGrenade(int nPlayer) pActor->spr.angle = pPlayerActor->spr.angle; pActor->spr.intowner = nPlayer; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; diff --git a/source/games/exhumed/src/items.cpp b/source/games/exhumed/src/items.cpp index fce309246..dee19e803 100644 --- a/source/games/exhumed/src/items.cpp +++ b/source/games/exhumed/src/items.cpp @@ -422,7 +422,7 @@ void DoRegenerates() pActor->spr.yint = 0; pActor->spr.xint = 0; - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_xvel(); pActor->clear_zvel(); diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index d73058bfa..0cb164501 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -78,7 +78,7 @@ void AILavaDudeLimb::Tick(RunListEvent* ev) if (coll.type || pActor->spr.shade > 100) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); runlist_DoSubRunRec(pActor->spr.intowner); @@ -123,7 +123,7 @@ void BuildLava(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.yoffset = 0; pActor->spr.picnum = seq_GetSeqPicnum(kSeqLavag, LavadudeSeq[3].a, 0); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->set_int_ang(nAngle); pActor->spr.hitag = 0; diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index e88979828..d09b7edfc 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -66,7 +66,7 @@ void BuildLion(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.yoffset = 0; pActor->set_int_ang(nAngle); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.hitag = 0; @@ -120,7 +120,7 @@ void AILion::Damage(RunListEvent* ev) { // R.I.P. pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; @@ -161,7 +161,7 @@ void AILion::Damage(RunListEvent* ev) { pActor->nAction = 4; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } else if (RandomSize(1)) { @@ -174,7 +174,7 @@ void AILion::Damage(RunListEvent* ev) { pActor->nAction = 8; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; } @@ -258,7 +258,7 @@ void AILion::Tick(RunListEvent* ev) else { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } pActor->nCount = 100; @@ -305,7 +305,7 @@ void AILion::Tick(RunListEvent* ev) pActor->nAction = 9; pActor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } else { @@ -529,7 +529,7 @@ void AILion::Tick(RunListEvent* ev) pActor->nCount = 100; pActor->pTarget = nullptr; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } } diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 95b6ea0c5..9d982c8e7 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -1360,7 +1360,7 @@ void AICreatureChunk::Tick(RunListEvent* ev) pSector = pActor->sector(); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.pos.Z = pSector->floorz; } diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index 7a799c45f..ac197ba52 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -54,7 +54,7 @@ void BuildMummy(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.shade = -12; pActor->spr.clipdist = 32; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.xrepeat = 42; pActor->spr.yrepeat = 42; @@ -148,7 +148,7 @@ void AIMummy::Tick(RunListEvent* ev) pActor->nAction = 0; pActor->nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } @@ -208,7 +208,7 @@ void AIMummy::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); return; } } @@ -243,14 +243,14 @@ void AIMummy::Tick(RunListEvent* ev) { pActor->spr.yvel -= 1024; if (pActor->spr.yvel < 0) { - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } else if (pActor->spr.yvel < 0) { pActor->spr.yvel += 1024; if (pActor->spr.yvel > 0) { - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } } @@ -276,7 +276,7 @@ void AIMummy::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } return; @@ -380,7 +380,7 @@ void AIMummy::Tick(RunListEvent* ev) if (bVal) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; pActor->nAction = 0; @@ -441,7 +441,7 @@ void AIMummy::Damage(RunListEvent* ev) pActor->nAction = 4; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.pos.Z = pActor->sector()->floorz; } @@ -453,7 +453,7 @@ void AIMummy::Damage(RunListEvent* ev) pActor->nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 8139e83fa..cf0c03e58 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -1203,7 +1203,7 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx) pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.extra = -1; @@ -1447,7 +1447,7 @@ void AISpark::Tick(RunListEvent* ev) } pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); if (pActor->spr.picnum > kTile3000) { @@ -1584,7 +1584,7 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector) pActor->spr.xrepeat = nRepeat; pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.extra = -1; pActor->spr.lotag = runlist_HeadRun() + 1; @@ -1785,7 +1785,7 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag) // 0x7FFD to ensure set as blocking ('B' and 'H') sprite and also disable translucency and set not invisible pActor->spr.cstat = (pActor->spr.cstat | CSTAT_SPRITE_BLOCK_ALL) & ~(CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_INVISIBLE); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.extra = -1; pActor->spr.lotag = runlist_HeadRun() + 1; @@ -1902,7 +1902,7 @@ void AIObject::Tick(RunListEvent* ev) if (nMov.type == kHitSprite) { - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_xvel(); } } @@ -2032,7 +2032,7 @@ void AIObject::RadialDamage(RunListEvent* ev) if (pActor->spr.statnum == kStatExplodeTarget) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); } else if (pActor->spr.statnum != kStatAnubisDrum) diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index a71c520b9..a503f00f0 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -301,7 +301,7 @@ void RestartPlayer(int nPlayer) int nHeight = GetActorHeight(pActor); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); nStandHeight = nHeight; @@ -545,7 +545,7 @@ void SetPlayerMummified(int nPlayer, int bIsMummified) { DExhumedActor* pActor = PlayerList[nPlayer].pActor; - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_xvel(); PlayerList[nPlayer].bIsMummified = bIsMummified; @@ -924,7 +924,7 @@ void AIPlayer::Tick(RunListEvent* ev) lPlayerYVel = 0; pPlayerActor->clear_xvel(); - pPlayerActor->spr.yvel = 0; + pPlayerActor->clear_yvel(); pPlayerActor->clear_zvel(); if (nFreeze < 1) @@ -977,7 +977,7 @@ void AIPlayer::Tick(RunListEvent* ev) if (PlayerList[nPlayer].nHealth <= 0) { pPlayerActor->clear_xvel(); - pPlayerActor->spr.yvel = 0; + pPlayerActor->clear_yvel(); StopActorSound(pPlayerActor); PlayFXAtXYZ(StaticSound[kSoundJonFDie], pPlayerActor->spr.pos, CHANF_NONE, 1); // CHECKME diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index 99ae35307..21311bc13 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -454,7 +454,7 @@ void BuildQueenEgg(int nQueen, int nVal) pActor2->spr.xrepeat = 60; pActor2->spr.yrepeat = 60; pActor2->clear_xvel(); - pActor2->spr.yvel = 0; + pActor2->clear_yvel(); pActor2->set_int_zvel(-2000); pActor2->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; } @@ -817,7 +817,7 @@ void AIQueenHead::Tick(RunListEvent* ev) else { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); if (pActor->float_zvel() == 0) { @@ -1099,7 +1099,7 @@ void BuildQueen(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.picnum = 1; pActor->set_int_ang(nAngle); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.extra = -1; @@ -1223,7 +1223,7 @@ void AIQueen::Tick(RunListEvent* ev) { QueenList[nQueen].nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); QueenList[nQueen].nAction = si + 4; QueenList[nQueen].nIndex = RandomSize(6) + 30; break; @@ -1291,7 +1291,7 @@ void AIQueen::Tick(RunListEvent* ev) QueenList[nQueen].pTarget = nullptr; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } @@ -1420,7 +1420,7 @@ void AIQueen::Damage(RunListEvent* ev) if (QueenList[nQueen].nHealth <= 0) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); QueenList[nQueen].nAction2++; diff --git a/source/games/exhumed/src/ra.cpp b/source/games/exhumed/src/ra.cpp index c91bfc206..e57d322a6 100644 --- a/source/games/exhumed/src/ra.cpp +++ b/source/games/exhumed/src/ra.cpp @@ -91,7 +91,7 @@ void BuildRa(int nPlayer) pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.extra = -1; pActor->spr.lotag = runlist_HeadRun() + 1; diff --git a/source/games/exhumed/src/rat.cpp b/source/games/exhumed/src/rat.cpp index f311d394c..047d27b0a 100644 --- a/source/games/exhumed/src/rat.cpp +++ b/source/games/exhumed/src/rat.cpp @@ -98,7 +98,7 @@ void BuildRat(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, i pActor->spr.xrepeat = 50; pActor->spr.yrepeat = 50; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.hitag = 0; @@ -172,7 +172,7 @@ void AIRat::Damage(RunListEvent* ev) { pActor->spr.cstat = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->nAction = 3; pActor->nFrame = 0; } @@ -235,7 +235,7 @@ void AIRat::Tick(RunListEvent* ev) pActor->pTarget = nullptr; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); return; } @@ -273,7 +273,7 @@ void AIRat::Tick(RunListEvent* ev) pActor->pTarget = nullptr; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } MoveCreature(pActor); @@ -300,7 +300,7 @@ void AIRat::Tick(RunListEvent* ev) pActor->nPhase = RandomSize(3); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); return; } case 2: @@ -320,7 +320,7 @@ void AIRat::Tick(RunListEvent* ev) if (pActor->float_xvel() != 0 || pActor->spr.yvel) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); return; } diff --git a/source/games/exhumed/src/rex.cpp b/source/games/exhumed/src/rex.cpp index e0faa259f..e579eff51 100644 --- a/source/games/exhumed/src/rex.cpp +++ b/source/games/exhumed/src/rex.cpp @@ -62,7 +62,7 @@ void BuildRex(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, i pActor->spr.yoffset = 0; pActor->set_int_ang(nAngle); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.extra = -1; @@ -123,7 +123,7 @@ void AIRex::Damage(RunListEvent* ev) if (pActor->nHealth <= 0) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; @@ -247,7 +247,7 @@ void AIRex::Tick(RunListEvent* ev) pActor->nAction = 5; pActor->nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); return; } else @@ -438,7 +438,7 @@ void AIRex::Tick(RunListEvent* ev) pActor->nCount = 0; pActor->pTarget = nullptr; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } return; diff --git a/source/games/exhumed/src/roach.cpp b/source/games/exhumed/src/roach.cpp index 01ab2717c..c8257f6d6 100644 --- a/source/games/exhumed/src/roach.cpp +++ b/source/games/exhumed/src/roach.cpp @@ -60,7 +60,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, const DVector3& pos, sectortyp pActor->spr.xrepeat = 40; pActor->spr.yrepeat = 40; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; @@ -131,7 +131,7 @@ void AIRoach::Damage(RunListEvent* ev) if (pActor->nHealth <= 0) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; @@ -272,7 +272,7 @@ void AIRoach::Tick(RunListEvent* ev) pActor->nAction = 3; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->spr.angle = VecToAngle(pTarget->spr.pos - pActor->spr.pos); pActor->nFrame = 0; @@ -301,7 +301,7 @@ void AIRoach::Tick(RunListEvent* ev) pActor->nAction = 3; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->spr.angle = VecToAngle(pTarget->spr.pos - pActor->spr.pos); pActor->nFrame = 0; @@ -315,7 +315,7 @@ void AIRoach::Tick(RunListEvent* ev) pActor->nCount = 100; pActor->pTarget = nullptr; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } return; diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index 4c9f4f9d5..56716512e 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -63,7 +63,7 @@ void BuildScorp(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.yoffset = 0; pActor->set_int_ang(nAngle); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.extra = -1; @@ -128,7 +128,7 @@ void AIScorp::Damage(RunListEvent* ev) pActor->nCount = 10; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; @@ -427,7 +427,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector())) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->spr.angle = VecToAngle(pTarget->spr.pos - pActor->spr.pos); pActor->nIndex = RandomSize(2) + RandomSize(3); @@ -456,7 +456,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) pActor->pTarget = nullptr; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index 5c85c73c8..0d9ed4111 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -57,7 +57,7 @@ void BuildSet(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, i pActor->spr.shade = -12; pActor->spr.clipdist = 110; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.xrepeat = 87; pActor->spr.yrepeat = 96; @@ -106,7 +106,7 @@ void BuildSoul(DExhumedActor* pSet) pActor->spr.picnum = seq_GetSeqPicnum(kSeqSet, 75, 0); pActor->set_int_ang(RandomSize(11)); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->set_int_zvel((-256) - RandomSize(10)); pActor->spr.pos = DVector3(pSet->spr.pos.XY(), RandomSize(8) + 32 + pActor->sector()->ceilingz - GetActorHeightF(pActor)); @@ -186,7 +186,7 @@ void AISet::Damage(RunListEvent* ev) if (pActor->nHealth <= 0) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; @@ -327,7 +327,7 @@ void AISet::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->pTarget = FindPlayer(pActor, 1000); } @@ -358,7 +358,7 @@ void AISet::Tick(RunListEvent* ev) pActor->nAction = 7; pActor->nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); return; } case 1: @@ -369,7 +369,7 @@ void AISet::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->nRun = 5; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); return; } default: @@ -412,7 +412,7 @@ void AISet::Tick(RunListEvent* ev) pActor->nAction = 7; pActor->nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); return; } } @@ -441,7 +441,7 @@ void AISet::Tick(RunListEvent* ev) pActor->nAction = 7; pActor->nFrame = 0; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); return; } } @@ -552,7 +552,7 @@ void AISet::Tick(RunListEvent* ev) if (bVal) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); PlotCourseToSprite(pActor, pTarget); @@ -561,7 +561,7 @@ void AISet::Tick(RunListEvent* ev) pActor->nRun = 5; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } return; } @@ -609,7 +609,7 @@ void AISet::Tick(RunListEvent* ev) pActor->nCount = 100; pActor->pTarget = nullptr; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); } } } diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index b91d4504a..748c3719e 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -216,7 +216,7 @@ void BuildSnake(int nPlayer, int zVal) pActor->spr.yoffset = 0; pActor->spr.angle = pPlayerActor->spr.angle; pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.hitag = 0; pActor->spr.extra = -1; diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index c274741ef..6379a94e4 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -55,7 +55,7 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, const DVector3& pos, sectortype* spp->spr.shade = -12; spp->spr.clipdist = 15; spp->clear_xvel(); - spp->spr.yvel = 0; + spp->clear_yvel(); spp->clear_zvel(); spp->spr.xrepeat = 40; spp->spr.yrepeat = 40; @@ -199,7 +199,7 @@ void AISpider::Tick(RunListEvent* ev) else { spp->clear_xvel(); - spp->spr.yvel = 0; + spp->clear_yvel(); } if (spp->nAction == 1 && RandomBit()) @@ -257,7 +257,7 @@ void AISpider::Tick(RunListEvent* ev) { spp->nAction = 0; spp->clear_xvel(); - spp->spr.yvel = 0; + spp->clear_yvel(); } spp->nFrame = 0; @@ -272,7 +272,7 @@ void AISpider::Tick(RunListEvent* ev) spp->nFrame = 0; spp->clear_xvel(); - spp->spr.yvel = 0; + spp->clear_yvel(); } auto nMov = movesprite(spp, spp->int_xvel() << nVel, spp->spr.yvel << nVel, spp->int_zvel(), 1280, -1280, CLIPMASK0); diff --git a/source/games/exhumed/src/wasp.cpp b/source/games/exhumed/src/wasp.cpp index d6847d03f..07e2bd7c4 100644 --- a/source/games/exhumed/src/wasp.cpp +++ b/source/games/exhumed/src/wasp.cpp @@ -75,7 +75,7 @@ DExhumedActor* BuildWasp(DExhumedActor* pActor, const DVector3& pos, sectortype* pActor->spr.picnum = 1; pActor->set_int_ang(nAngle); pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; @@ -288,7 +288,7 @@ void AIWasp::Tick(RunListEvent* ev) if (nChaseVal.actor() == pTarget) { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); runlist_DamageEnemy(pTarget, pActor, pActor->nDamage); pActor->nAction = 2; pActor->nFrame = 0; @@ -321,7 +321,7 @@ void AIWasp::Tick(RunListEvent* ev) //if (nMove.type != kHitNone) // The code messed up the return value so this check always was true. { pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->set_int_zvel(1024); pActor->nAction = 5; pActor->nFrame = 0; @@ -344,7 +344,7 @@ void AIWasp::Tick(RunListEvent* ev) } pActor->clear_xvel(); - pActor->spr.yvel = 0; + pActor->clear_yvel(); pActor->clear_zvel(); pActor->nAction = 6; pActor->nFrame = 0;