- fixed Dehacked check for A_ConsumeAmmo.

This must use the internal function name.
This commit is contained in:
Christoph Oelckers 2022-04-14 12:21:24 +02:00
parent 8b1d671f6b
commit d0e1aea273
2 changed files with 4 additions and 3 deletions

View file

@ -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<PFunction>(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;

View file

@ -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)