mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-05-31 09:21:36 +00:00
- try to preserve a bit more information about incorrect use of user variables to print more meaningful error messages. This is not complete yet and will need integration with the previous commit.
This commit is contained in:
parent
ac0413838c
commit
f238f0ba5c
11 changed files with 94 additions and 5 deletions
|
@ -78,6 +78,7 @@
|
|||
#include "p_spec.h"
|
||||
#include "templates.h"
|
||||
#include "vm.h"
|
||||
#include "v_text.h"
|
||||
#include "thingdef.h"
|
||||
#include "math/cmath.h"
|
||||
|
||||
|
@ -132,6 +133,15 @@ bool ACustomInventory::CallStateChain (AActor *actor, FState *state)
|
|||
|
||||
if (state->ActionFunc != NULL)
|
||||
{
|
||||
if (state->ActionFunc->Unsafe)
|
||||
{
|
||||
// If an unsafe function (i.e. one that accesses user variables) is being detected, print a warning once and remove the bogus function. We may not call it because that would inevitably crash.
|
||||
auto owner = FState::StaticFindStateOwner(state);
|
||||
Printf(TEXTCOLOR_RED "Unsafe state call in state %s.%d to %s which accesses user variables. The action function has been removed from this state\n",
|
||||
owner->TypeName.GetChars(), state - owner->OwnedStates, static_cast<VMScriptFunction *>(state->ActionFunc)->PrintableName.GetChars());
|
||||
state->ActionFunc = nullptr;
|
||||
}
|
||||
|
||||
VMFrameStack stack;
|
||||
PPrototype *proto = state->ActionFunc->Proto;
|
||||
VMReturn *wantret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue