mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
- fixed crash with weapons which remove themselves from the inventory but continue calling action functions.
This is still an error, so now this throws a meaningful exception.
This commit is contained in:
parent
6faeadaceb
commit
b6d0492478
2 changed files with 9 additions and 1 deletions
|
@ -131,6 +131,10 @@ void FState::CheckCallerType(AActor *self, AActor *stateowner)
|
||||||
ThrowAbortException(X_OTHER, "Bad function prototype in function call to %s", ActionFunc->PrintableName.GetChars());
|
ThrowAbortException(X_OTHER, "Bad function prototype in function call to %s", ActionFunc->PrintableName.GetChars());
|
||||||
}
|
}
|
||||||
auto cls = static_cast<PObjectPointer*>(requiredType)->PointedClass();
|
auto cls = static_cast<PObjectPointer*>(requiredType)->PointedClass();
|
||||||
|
if (check == nullptr)
|
||||||
|
{
|
||||||
|
ThrowAbortException(X_OTHER, "%s called without valid caller. %s expected", ActionFunc->PrintableName.GetChars(), cls->TypeName.GetChars());
|
||||||
|
}
|
||||||
if (!check->IsKindOf(cls))
|
if (!check->IsKindOf(cls))
|
||||||
{
|
{
|
||||||
ThrowAbortException(X_OTHER, "Invalid class %s in function call to %s. %s expected", check->GetClass()->TypeName.GetChars(), ActionFunc->PrintableName.GetChars(), cls->TypeName.GetChars());
|
ThrowAbortException(X_OTHER, "Invalid class %s in function call to %s. %s expected", check->GetClass()->TypeName.GetChars(), ActionFunc->PrintableName.GetChars(), cls->TypeName.GetChars());
|
||||||
|
@ -223,6 +227,10 @@ bool FState::CallAction(AActor *self, AActor *stateowner, FStateParamInfo *info,
|
||||||
}
|
}
|
||||||
err.stacktrace.AppendFormat("Called from %sstate %s in %s\n", callinfo, FState::StaticGetStateName(this).GetChars(), stateowner->GetClass()->TypeName.GetChars());
|
err.stacktrace.AppendFormat("Called from %sstate %s in %s\n", callinfo, FState::StaticGetStateName(this).GetChars(), stateowner->GetClass()->TypeName.GetChars());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
err.stacktrace.AppendFormat("Called from state %s\n", FState::StaticGetStateName(this).GetChars());
|
||||||
|
}
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2256,7 +2256,7 @@ class PSprite : Object native play
|
||||||
Tics--;
|
Tics--;
|
||||||
// [BC] Apply double firing speed.
|
// [BC] Apply double firing speed.
|
||||||
if (bPowDouble && Tics && (Owner.mo.FindInventory ("PowerDoubleFiringSpeed", true))) Tics--;
|
if (bPowDouble && Tics && (Owner.mo.FindInventory ("PowerDoubleFiringSpeed", true))) Tics--;
|
||||||
if (!Tics) SetState(CurState.NextState);
|
if (!Tics && Caller != null) SetState(CurState.NextState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue