From 64cf9a4ec6544eac36ddad3203760f5e6d518294 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 22 Aug 2022 18:18:54 +0200 Subject: [PATCH] - pass vector position to actRadiusDamage --- source/games/blood/src/actor.cpp | 9 +++++---- source/games/blood/src/actor.h | 2 +- source/games/blood/src/aipod.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 9f29cbdbf..408e287aa 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2638,8 +2638,9 @@ int actFloorBounceVector(int* x, int* y, int* z, sectortype* pSector, int a5) // //--------------------------------------------------------------------------- -void actRadiusDamage(DBloodActor* source, int x, int y, int z, sectortype* pSector, int nDist, int baseDmg, int distDmg, DAMAGE_TYPE dmgType, int flags, int burn) +void actRadiusDamage(DBloodActor* source, const DVector3& pos, sectortype* pSector, int nDist, int baseDmg, int distDmg, DAMAGE_TYPE dmgType, int flags, int burn) { + int x = pos.X * worldtoint, y = pos.Y * worldtoint, z = pos.Z * worldtoint; auto pOwner = source->GetOwner(); const bool newSectCheckMethod = !cl_bloodvanillaexplosions && pOwner && pOwner->IsDudeActor() && !VanillaMode(); // use new sector checking logic auto sectorMap = GetClosestSpriteSectors(pSector, x, y, nDist, nullptr, newSectCheckMethod); @@ -2714,7 +2715,7 @@ static void actNapalmMove(DBloodActor* actor) if (Chance(0x8000)) actor->spr.cstat |= CSTAT_SPRITE_XFLIP; sfxPlay3DSound(actor, 303, 24 + (actor->spr.flags & 3), 1); - actRadiusDamage(pOwner, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), 128, 0, 60, kDamageExplode, 15, 120); + actRadiusDamage(pOwner, actor->spr.pos, actor->sector(), 128, 0, 60, kDamageExplode, 15, 120); if (actor->xspr.data4 > 1) { @@ -3952,7 +3953,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) evPostActor(actorHit, 0, kCallbackFXFlameLick); actBurnSprite(missileOwner, actorHit, 480); - actRadiusDamage(missileOwner, missileActor->int_pos().X, missileActor->int_pos().Y, missileActor->int_pos().Z, missileActor->sector(), 16, 20, 10, kDamageBullet, 6, 480); + actRadiusDamage(missileOwner, missileActor->spr.pos, missileActor->sector(), 16, 20, 10, kDamageBullet, 6, 480); // by NoOne: allow additional bullet damage for Flare Gun if (gGameOptions.weaponsV10x && !VanillaMode()) @@ -5721,7 +5722,7 @@ static void actCheckThings() case kThingPodGreenBall: if (hit.type == kHitSector) { - actRadiusDamage(actor->GetOwner(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), 200, 1, 20, kDamageExplode, 6, 0); + actRadiusDamage(actor->GetOwner(), actor->spr.pos, actor->sector(), 200, 1, 20, kDamageExplode, 6, 0); evPostActor(actor, 0, kCallbackFXPodBloodSplat); } else if (hit.type == kHitSprite) diff --git a/source/games/blood/src/actor.h b/source/games/blood/src/actor.h index f2723c0b7..de141a141 100644 --- a/source/games/blood/src/actor.h +++ b/source/games/blood/src/actor.h @@ -212,7 +212,7 @@ bool IsUnderwaterSector(sectortype* pSector); void actInit(TArray& actors); int actWallBounceVector(int *x, int *y, walltype* pWall, int a4); int actFloorBounceVector(int *x, int *y, int *z, sectortype* pSector, int a5); -void actRadiusDamage(DBloodActor* source, int x, int y, int z, sectortype* pSector, int nDist, int a7, int a8, DAMAGE_TYPE a9, int a10, int a11); +void actRadiusDamage(DBloodActor* source, const DVector3& pos, sectortype* pSector, int nDist, int a7, int a8, DAMAGE_TYPE a9, int a10, int a11); DBloodActor *actDropObject(DBloodActor *pSprite, int nType); bool actHealDude(DBloodActor* pXDude, int a2, int a3); void actKillDude(DBloodActor* a1, DBloodActor* pSprite, DAMAGE_TYPE a3, int a4); diff --git a/source/games/blood/src/aipod.cpp b/source/games/blood/src/aipod.cpp index b80eab7c0..180f125e2 100644 --- a/source/games/blood/src/aipod.cpp +++ b/source/games/blood/src/aipod.cpp @@ -122,7 +122,7 @@ void sub_70284(int, DBloodActor* actor) nDist = 75; break; } - actRadiusDamage(actor, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), nDist, 1, 5 * (1 + gGameOptions.nDifficulty), dmgType, 2, nBurn); + actRadiusDamage(actor, actor->spr.pos, actor->sector(), nDist, 1, 5 * (1 + gGameOptions.nDifficulty), dmgType, 2, nBurn); } static void aiPodSearch(DBloodActor* actor)