From 82e5e2daa949c66f46e577c9ffa7c1e1bf99aa62 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 25 Nov 2016 12:31:13 +0100 Subject: [PATCH] - fixed a variable mixup in Dehacked weapon initialization. This ultimately failed to set the weapon's AmmoUse field and made the weapon fail to detect it's out of ammo. --- src/d_dehacked.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 679c8c1adf..624116e06f 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -3085,10 +3085,10 @@ void FinishDehPatch () StateVisited[state] = true; for(unsigned j = 0; AmmoPerAttacks[j].func != NAME_None; j++) { - if (AmmoPerAttacks[i].ptr == nullptr) + if (AmmoPerAttacks[j].ptr == nullptr) { - auto p = dyn_cast(RUNTIME_CLASS(AStateProvider)->Symbols.FindSymbol(AmmoPerAttacks[i].func, true)); - if (p != nullptr) AmmoPerAttacks[i].ptr = p->Variants[0].Implementation; + auto p = dyn_cast(RUNTIME_CLASS(AStateProvider)->Symbols.FindSymbol(AmmoPerAttacks[j].func, true)); + if (p != nullptr) AmmoPerAttacks[j].ptr = p->Variants[0].Implementation; } if (state->ActionFunc == AmmoPerAttacks[j].ptr) {