Skip to content

Commit

Permalink
Move to the next event before yielding the interpreter when "Erase Ev…
Browse files Browse the repository at this point in the history
…ent" is called from a parallel process.

This prevents a hang when a PP uses "Call Event" and the called event erases itself.

Fix #1243
  • Loading branch information
Ghabry committed Aug 12, 2017
1 parent 9af89a5 commit 5176f2c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/game_interpreter.cpp
Expand Up @@ -2395,8 +2395,13 @@ bool Game_Interpreter::CommandEraseEvent(RPG::EventCommand const& /* com */) { /
evnt->SetActive(false);

// Parallel map events shall stop immediately
if (!main_flag)
if (!main_flag) {
// When the event was called indirectly from a parallel process
// event execution continues after a yield.
// Increment the index for this special case.
index++;
return false;
}
}

return true;
Expand Down

0 comments on commit 5176f2c

Please sign in to comment.