chronosv2/Cv2MVPlugins

Racing condition in DCEAllAllyDead

lekoder opened this issue · 3 comments

In random encounters, when processing DCEAllAllyDead, while common event is called (via $gameTemp.reserveCommonEvent(DCEAllAllyDead);) game over scene is rendered regardless, even if common event revives the party.

Hm, guess that's what I get for only using an event-initiated combat (since I personally don't use DCE to do that in my own project, and did the testing of some of the functionality using an event-initiated battle. Thanks for the catch! Though I just realized I'd personally reset that state after the event runs if at all possible because I think just setting it to can_lose = true would make the game never game-over even on non-revive situations, wouldn't it?

I think can_lose is initialized on each combat start. Let me check sources...
..yep, rpg_managers.js 1945:1967 looks like it.

Oh, okay, I think I get it now. I'll update in the plugindesc that setting up All Allies Dead DCE needs to have a game over state to check against.
My concern was that if it so happens that the All Allies Dead DCE step doesn't trigger a Game Over or end the combat the game will likely throw an exception because there is no "On Loss" event defined. But I guess if you're using All Allies Dead you're going to check on that stuff yourself to see if the condition needs to execute anyway.