Crash fix

git-svn-id: https://svn.eduke32.com/eduke32@6493 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2017-10-31 02:09:39 +00:00
parent c52e003e2a
commit 7bdd0e1361

View file

@ -6444,17 +6444,17 @@ void C_Compile(const char *fileName)
for (int i = 0; i < MAXEVENTS; ++i)
{
if (!apScriptGameEventEnd[i])
continue;
intptr_t *eventEnd = apScript + apScriptGameEventEnd[i];
if (eventEnd)
// C_FillEventBreakStackWithEndEvent
intptr_t *breakPtr = (intptr_t*)*(eventEnd + 2);
while (breakPtr)
{
// C_FillEventBreakStackWithEndEvent
intptr_t *breakPtr = (intptr_t*)*(eventEnd + 2);
while (breakPtr)
{
breakPtr = apScript + (intptr_t)breakPtr;
*(breakPtr-2) = CON_ENDEVENT | (g_lineNumber << 12);
breakPtr = (intptr_t*)*breakPtr;
}
breakPtr = apScript + (intptr_t)breakPtr;
*(breakPtr-2) = CON_ENDEVENT | (g_lineNumber << 12);
breakPtr = (intptr_t*)*breakPtr;
}
}