mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-13 22:42:07 +00:00
Fixed ACS scripts executing a function from another library that cause a division/modulus of zero from aborting the game.
This commit is contained in:
parent
e0394ef16a
commit
162ab3c4ec
1 changed files with 5 additions and 0 deletions
|
@ -10337,6 +10337,11 @@ scriptwait:
|
|||
}
|
||||
}
|
||||
|
||||
// There are several or more p-codes that can trigger a division or modulus of zero.
|
||||
// Reset the active behavior back to the original if this happens.
|
||||
if (state == SCRIPT_DivideBy0 || state == SCRIPT_ModulusBy0)
|
||||
activeBehavior = savedActiveBehavior;
|
||||
|
||||
if (runaway != 0 && InModuleScriptNumber >= 0)
|
||||
{
|
||||
auto scriptptr = activeBehavior->GetScriptPtr(InModuleScriptNumber);
|
||||
|
|
Loading…
Reference in a new issue