- clear_yvel

This commit is contained in:
Christoph Oelckers 2022-09-01 17:19:28 +02:00
parent f8ba5bb660
commit b0e67ab88d
24 changed files with 120 additions and 89 deletions

View file

@ -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)

View file

@ -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();

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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));

View file

@ -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;

View file

@ -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();

View file

@ -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;

View file

@ -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();
}
}
}

View file

@ -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;
}

View file

@ -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();
}
}

View file

@ -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)

View file

@ -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

View file

@ -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++;

View file

@ -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;

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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();
}
}

View file

@ -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();
}
}
}

View file

@ -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;

View file

@ -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);

View file

@ -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;