From d0e1aea273caae5c58500f2df699c444e3ecd218 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 14 Apr 2022 12:21:24 +0200 Subject: [PATCH] - fixed Dehacked check for A_ConsumeAmmo. This must use the internal function name. --- src/gamedata/d_dehacked.cpp | 5 +++-- src/namedef_custom.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index 7ed171374..cf8e8ea7a 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -237,7 +237,7 @@ static AmmoPerAttack AmmoPerAttacks[] = { { NAME_A_FireBFG, -1}, // uses deh.BFGCells { NAME_A_FireOldBFG, 1}, { NAME_A_FireRailgun, 1}, - { NAME_A_ConsumeAmmo, 1}, // MBF21 + { NAME_MBF21_ConsumeAmmo, 1}, // MBF21 { NAME_None, 0} }; @@ -3587,8 +3587,9 @@ void FinishDehPatch () { auto p = dyn_cast(wcls->FindSymbol(AmmoPerAttacks[j].func, true)); if (p != nullptr) AmmoPerAttacks[j].ptr = p->Variants[0].Implementation; + assert(AmmoPerAttacks[j].ptr); } - if (state->ActionFunc == AmmoPerAttacks[j].ptr) + if (state->ActionFunc == AmmoPerAttacks[j].ptr && AmmoPerAttacks[j].ptr) { found = true; int use = AmmoPerAttacks[j].ammocount; diff --git a/src/namedef_custom.h b/src/namedef_custom.h index 1ca25a1f1..6f7bcbc78 100644 --- a/src/namedef_custom.h +++ b/src/namedef_custom.h @@ -233,7 +233,7 @@ xx(A_FirePlasma) xx(A_FireBFG) xx(A_FireOldBFG) xx(A_FireRailgun) -xx(A_ConsumeAmmo) +xx(MBF21_ConsumeAmmo) // Special translation names xx(RainPillar1)