diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 22c87de2b..8c6c8260f 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2709,7 +2709,7 @@ static void actNapalmMove(DBloodActor* actor) for (int i = 0; i < 2; i++) { double t1 = RandomD(3.2) + 3.2; - auto rndang = DAngle::fromBuild(Random2(0x71)); + auto rndang = Random2A(0x71); actor->spr.angle = (ang + rndang).Normalized360(); auto spawned = actFireThing(actor, 0., 0., -0.5774, kThingNapalmBall, t1); spawned->SetOwner(actor->GetOwner()); @@ -4560,7 +4560,7 @@ static Collision MoveThing(DBloodActor* actor) actor->vel.Z += FixedToFloat(58254); if (actor->spr.type == kThingZombieHead) { - auto* fxActor = gFX.fxSpawnActor(FX_27, actor->sector(), actor->spr.pos, 0); + auto* fxActor = gFX.fxSpawnActor(FX_27, actor->sector(), actor->spr.pos, nullAngle); if (fxActor) { auto vect1 = DVector2(64./15., 0.).Rotated(DAngle::fromBuild((PlayClock * 11) & 2047)); diff --git a/source/games/blood/src/ai.h b/source/games/blood/src/ai.h index 58f9cffd1..5f34acf9d 100644 --- a/source/games/blood/src/ai.h +++ b/source/games/blood/src/ai.h @@ -94,11 +94,5 @@ void aiProcessDudes(void); void aiInit(void); void aiInitSprite(DBloodActor* pSprite); bool CanMove(DBloodActor* pSprite, DBloodActor* target, DAngle nAngle, double nRange); -/* -inline bool CanMove(DBloodActor* pSprite, DBloodActor* target, DAngle nAngle, double nRange) -{ - return CanMove(pSprite, target, nAngle.Buildang(), nRange); -} -*/ END_BLD_NS diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index f097190f1..dcafff91f 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -38,7 +38,7 @@ struct FXDATA { int16_t flags; // flags int32_t gravity; // gravity int32_t drag; // air drag - int32_t ate; + int32_t defangle; int16_t picnum; // picnum uint8_t xrepeat; // xrepeat uint8_t yrepeat; // yrepeat @@ -135,12 +135,7 @@ void CFX::remove(DBloodActor* actor) // //--------------------------------------------------------------------------- -DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, const DVector3& pos, DAngle a6) -{ - return fxSpawnActor(nFx, pSector, pos, a6.Buildang()); -} - -DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, const DVector3& pos, unsigned int a6) +DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, const DVector3& pos, DAngle angle) { if (pSector == nullptr) return nullptr; @@ -189,10 +184,10 @@ DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, const DVector3& p actor->addX(); seqSpawn(pFX->seq, actor, -1); } - if (a6 == 0) - a6 = pFX->ate; - if (a6) - evPostActor(actor, a6 + Random2(a6 >> 1), kCallbackRemove); + if (angle == nullAngle) + angle = mapangle(pFX->defangle); + if (angle != nullAngle) + evPostActor(actor, angle.Buildang() + Random2(angle.Buildang() >> 1), kCallbackRemove); return actor; }