diff --git a/src/info.cpp b/src/info.cpp index a513f67aff..c4be50d47f 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -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()); } auto cls = static_cast(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)) { 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()); } + else + { + err.stacktrace.AppendFormat("Called from state %s\n", FState::StaticGetStateName(this).GetChars()); + } throw; } diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index c4fa074843..b56a60a543 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -2256,7 +2256,7 @@ class PSprite : Object native play Tics--; // [BC] Apply double firing speed. if (bPowDouble && Tics && (Owner.mo.FindInventory ("PowerDoubleFiringSpeed", true))) Tics--; - if (!Tics) SetState(CurState.NextState); + if (!Tics && Caller != null) SetState(CurState.NextState); } } }