From acb244653cd45e33372c7fb676950c9a2adef120 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 6 May 2022 01:40:27 +0200 Subject: [PATCH] - several more Blood fixes copied from NBlood --- source/games/blood/src/actor.cpp | 2 +- source/games/blood/src/ai.cpp | 1 + source/games/blood/src/aicaleb.cpp | 2 ++ source/games/blood/src/callback.cpp | 2 +- source/games/blood/src/gameutil.cpp | 4 ++-- source/games/blood/src/weapon.cpp | 14 +++++++------- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 8b212f7ec..207931686 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -6377,7 +6377,7 @@ DBloodActor* actSpawnThing(sectortype* pSector, int x, int y, int z, int nThingT actor->xspr.data1 = (nThingType == kThingBloodBits) ? 19 : 8; actor->xspr.data2 = 0; actor->xspr.data3 = 0; - actor->xspr.data4 = 318; + actor->xspr.data4 = 319; actor->xspr.TargetPos.X = PlayClock + 180; actor->xspr.locked = 1; actor->xspr.state = 1; diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 4211b7a86..3410fe05a 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -1757,6 +1757,7 @@ void aiInitSprite(DBloodActor* actor) case kDudeZombieAxeBuried: { pDudeExtraE->thinkTime = 0; aiNewState(actor, &zombieEIdle); + actor->spr.flags &= ~1; break; } case kDudeGargoyleFlesh: diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index 4f26e6b1a..c66f419bb 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -263,6 +263,8 @@ static void calebThinkSwimChase(DBloodActor* actor) else aiNewState(actor, &tinycaleb13967C); } + else + aiNewState(actor, &tinycaleb13967C); } return; } diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index 4cc27cf05..d1787dacb 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -653,7 +653,7 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19 int nDist = Random(16) << 4; int x = actor->spr.pos.X + MulScale(nDist, Cos(nAngle), 28); int y = actor->spr.pos.Y + MulScale(nDist, Sin(nAngle), 28); - if (actor->spr.ang == 1024) + if (actor->spr.ang == 1024 && actor->spr.type == 53) { int nChannel = 28 + (actor->GetIndex() & 2); assert(nChannel < 32); diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index c56b19caa..60d998187 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -398,11 +398,11 @@ int HitScan(DBloodActor* actor, int z, int dx, int dy, int dz, unsigned int nMas } else { - hitscangoal.X = hitscangoal.Y = 0x1ffffff; + hitscangoal.X = hitscangoal.Y = 0x1fffffff; } hitscan({ x, y, z }, actor->sector(), { dx, dy, dz << 4 }, gHitInfo, nMask); - hitscangoal.X = hitscangoal.Y = 0x1ffffff; + hitscangoal.X = hitscangoal.Y = 0x1fffffff; actor->spr.cstat = bakCstat; if (gHitInfo.actor() != nullptr) return 3; diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 0b5a2e760..9fc8256f5 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -1197,6 +1197,7 @@ void ThrowCan(int, PLAYER* pPlayer) if (spawned) { sfxPlay3DSound(spawned, 441, 0, 0); + spawned->spr.shade = -128; evPostActor(spawned, pPlayer->fuseTime, kCmdOn); spawned->xspr.Impact = 1; UseAmmo(pPlayer, 6, gAmmoItemData[0].count); @@ -1870,7 +1871,7 @@ void FireTesla(int nTrigger, PLAYER* pPlayer) } } playerFireMissile(pPlayer, pMissile->offset, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, pMissile->id); - UseAmmo(pPlayer, 7, pMissile->ammouse); + UseAmmo(pPlayer, pPlayer->weaponAmmo, pMissile->ammouse); sfxPlay3DSound(pPlayer->actor, pMissile->sound, 1, 0); pPlayer->visibility = pMissile->light; pPlayer->flashEffect = pMissile->flash; @@ -1995,7 +1996,6 @@ void AltFireLifeLeech(int, PLAYER* pPlayer) missile->xspr.Push = 1; missile->xspr.Proximity = 1; missile->xspr.DudeLockout = 1; - missile->xspr.data4 = ClipHigh(pPlayer->ammoCount[4], 12); missile->xspr.stateTimer = 1; evPostActor(missile, 120, kCallbackLeechStateTimer); if (gGameOptions.nGameType <= 1) @@ -2147,7 +2147,7 @@ static int WeaponFindLoaded(PLAYER* pPlayer, int* a2) } } } - else if (a2) + if (a2) *a2 = v14; return v4; } @@ -2259,9 +2259,9 @@ static bool processProxy(PLAYER* pPlayer) pPlayer->weaponState = 8; StartQAV(pPlayer, kQAVPROXTHRO, nClientThrowProx); } - break; + return true; } - return 0; + return false; } //--------------------------------------------------------------------------- @@ -2281,9 +2281,9 @@ static bool processRemote(PLAYER* pPlayer) pPlayer->weaponState = 11; StartQAV(pPlayer, kQAVREMTHRO, nClientThrowRemote); } - break; + return true; } - return 0; + return false; } //---------------------------------------------------------------------------