mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
Merge pull request #387 from alexey-lysiuk/fix_unknown_pcode_crash
Fixed potential crash in ACS engine
This commit is contained in:
commit
029fa1e691
1 changed files with 2 additions and 0 deletions
|
@ -6032,6 +6032,7 @@ int DLevelScript::RunScript ()
|
||||||
int sp = 0;
|
int sp = 0;
|
||||||
int *pc = this->pc;
|
int *pc = this->pc;
|
||||||
ACSFormat fmt = activeBehavior->GetFormat();
|
ACSFormat fmt = activeBehavior->GetFormat();
|
||||||
|
FBehavior* const savedActiveBehavior = activeBehavior;
|
||||||
unsigned int runaway = 0; // used to prevent infinite loops
|
unsigned int runaway = 0; // used to prevent infinite loops
|
||||||
int pcd;
|
int pcd;
|
||||||
FString work;
|
FString work;
|
||||||
|
@ -6065,6 +6066,7 @@ int DLevelScript::RunScript ()
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
Printf ("Unknown P-Code %d in %s\n", pcd, ScriptPresentation(script).GetChars());
|
Printf ("Unknown P-Code %d in %s\n", pcd, ScriptPresentation(script).GetChars());
|
||||||
|
activeBehavior = savedActiveBehavior;
|
||||||
// fall through
|
// fall through
|
||||||
case PCD_TERMINATE:
|
case PCD_TERMINATE:
|
||||||
DPrintf ("%s finished\n", ScriptPresentation(script).GetChars());
|
DPrintf ("%s finished\n", ScriptPresentation(script).GetChars());
|
||||||
|
|
Loading…
Reference in a new issue