mirror of https://github.com/ZDoom/gzdoom.git
- 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.
This commit is contained in:
parent
b5f55cacba
commit
82e5e2daa9
|
@ -3085,10 +3085,10 @@ void FinishDehPatch ()
|
||||||
StateVisited[state] = true;
|
StateVisited[state] = true;
|
||||||
for(unsigned j = 0; AmmoPerAttacks[j].func != NAME_None; j++)
|
for(unsigned j = 0; AmmoPerAttacks[j].func != NAME_None; j++)
|
||||||
{
|
{
|
||||||
if (AmmoPerAttacks[i].ptr == nullptr)
|
if (AmmoPerAttacks[j].ptr == nullptr)
|
||||||
{
|
{
|
||||||
auto p = dyn_cast<PFunction>(RUNTIME_CLASS(AStateProvider)->Symbols.FindSymbol(AmmoPerAttacks[i].func, true));
|
auto p = dyn_cast<PFunction>(RUNTIME_CLASS(AStateProvider)->Symbols.FindSymbol(AmmoPerAttacks[j].func, true));
|
||||||
if (p != nullptr) AmmoPerAttacks[i].ptr = p->Variants[0].Implementation;
|
if (p != nullptr) AmmoPerAttacks[j].ptr = p->Variants[0].Implementation;
|
||||||
}
|
}
|
||||||
if (state->ActionFunc == AmmoPerAttacks[j].ptr)
|
if (state->ActionFunc == AmmoPerAttacks[j].ptr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue