diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 78087a902..a1462a27c 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -6179,25 +6179,23 @@ DBloodActor* actSpawnSprite(DBloodActor* source, int nStat) // //--------------------------------------------------------------------------- -DBloodActor* actSpawnDude(DBloodActor* source, int nType, int a3, int a4) +DBloodActor* actSpawnDude(DBloodActor* source, int nType, double dist) { auto spawned = actSpawnSprite(source, kStatDude); if (!spawned) return nullptr; - int angle = source->int_ang(); + DAngle angle = source->spr.angle; int nDude = nType - kDudeBase; auto pos = source->spr.pos; - pos.Z += a4 * zinttoworld; - if (a3 >= 0) + if (dist >= 0) { - pos.X += mulscale30r(Cos(angle), a3) * inttoworld; - pos.Y += mulscale30r(Sin(angle), a3) * inttoworld; + pos.XY() += angle.ToVector() * dist; } spawned->spr.type = nType; if (!VanillaMode()) spawned->spr.inittype = nType; - spawned->set_int_ang(angle); + spawned->spr.angle = angle; SetActor(spawned, pos); spawned->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_BLOOD_BIT1; diff --git a/source/games/blood/src/actor.h b/source/games/blood/src/actor.h index 8e5cfb33c..c64b44033 100644 --- a/source/games/blood/src/actor.h +++ b/source/games/blood/src/actor.h @@ -223,7 +223,7 @@ void actExplodeSprite(DBloodActor *pSprite); void actActivateGibObject(DBloodActor *actor); void actProcessSprites(void); DBloodActor* actSpawnSprite(sectortype* pSector, const DVector3& pos, int nStat, bool a6); -DBloodActor* actSpawnDude(DBloodActor* pSource, int nType, int a3, int a4); +DBloodActor* actSpawnDude(DBloodActor* pSource, int nType, double dist); DBloodActor * actSpawnSprite(DBloodActor *pSource, int nStat); DBloodActor * actSpawnThing(sectortype* pSector, int x, int y, int z, int nThingType); DBloodActor* actFireThing(DBloodActor* actor, int xyoff, int zoff, int zvel, int thingType, int nSpeed); diff --git a/source/games/blood/src/aispid.cpp b/source/games/blood/src/aispid.cpp index fb7a328a4..d47a96da8 100644 --- a/source/games/blood/src/aispid.cpp +++ b/source/games/blood/src/aispid.cpp @@ -144,11 +144,11 @@ void SpidBirthSeqCallback(int, DBloodActor* actor) if (target->IsPlayerActor() && pDudeExtraE->birthCounter < 10) { if (nDist < 0x1a00 && nDist > 0x1400 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery) - spawned = actSpawnDude(actor, kDudeSpiderRed, actor->native_clipdist(), 0); + spawned = actSpawnDude(actor, kDudeSpiderRed, actor->fClipdist() * 0.25); else if (nDist < 0x1400 && nDist > 0xc00 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery) - spawned = actSpawnDude(actor, kDudeSpiderBrown, actor->native_clipdist(), 0); + spawned = actSpawnDude(actor, kDudeSpiderBrown, actor->fClipdist() * 0.25); else if (nDist < 0xc00 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery) - spawned = actSpawnDude(actor, kDudeSpiderBrown, actor->native_clipdist(), 0); + spawned = actSpawnDude(actor, kDudeSpiderBrown, actor->fClipdist() * 0.25); if (spawned) { diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index e930c24a4..87ff7c1ca 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -243,10 +243,10 @@ void genDudeAttack1(int, DBloodActor* actor) else if (pExtra->weaponType == kGenDudeWeaponSummon) { DBloodActor* spawned = nullptr; - int dist = actor->native_clipdist() << 4; + double dist = actor->fClipdist() * 4; if (pExtra->slaveCount <= gGameOptions.nDifficulty) { - if ((spawned = actSpawnDude(actor, pExtra->curWeapon, dist + Random(dist), 0)) != NULL) + if ((spawned = actSpawnDude(actor, pExtra->curWeapon, dist + RandomD(dist, 4))) != NULL) { spawned->SetOwner(actor); diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 670691928..e80ca6320 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1710,7 +1710,7 @@ void ProcessInput(PLAYER* pPlayer) if (pPlayer->handTime <= 0 && pPlayer->hand) { DBloodActor* pactor = pPlayer->actor; - auto spawned = actSpawnDude(pactor, kDudeHand, pPlayer->actor->native_clipdist() << 1, 0); + auto spawned = actSpawnDude(pactor, kDudeHand, pPlayer->actor->fClipdist() * 0.5); if (spawned) { spawned->spr.angle += DAngle180; diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index c13a13d5a..74a45db96 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -496,7 +496,7 @@ void OperateSprite(DBloodActor* actor, EVENT event) case kMarkerDudeSpawn: if (gGameOptions.nMonsterSettings && actor->xspr.data1 >= kDudeBase && actor->xspr.data1 < kDudeMax) { - auto spawned = actSpawnDude(actor, actor->xspr.data1, -1, 0); + auto spawned = actSpawnDude(actor, actor->xspr.data1, -1); if (spawned) { gKillMgr.AddKill(spawned); switch (actor->xspr.data1) {