EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
965 stars 183 forks source link

Lack of a warning message when an event from a previous map is called under specific conditions, and weird behaviour of text #3121

Open Mimigris opened 9 months ago

Mimigris commented 9 months ago

Player platform:

Windows, 64 bits continuous build of the Player.

Attach files (as a .zip archive or link them)

Eventcrash.zip

Describe the issue in detail and how to reproduce it:

Take a look at the testcase given, there is an event using Player Touch that teleports you, as well as a common event teleporting you when your coordinates are on the tile of the event. Walk on the entrance tile in the testcase while using the RPG_RT and wait one second while the line TEST A is displayed, then press enter. After being moved to the second map and pressing enter on the TEST B line, the game should crash on the RPG_RT ("An invalid event was specified."), while EasyRPG will continue without giving a warning message. For some reason, it seems that the ID of the event that you walked in in the first map (which used Player Touch as a trigger) is checked if it exists on the new map, due to being interrupted by the common event that moved you to a new map (it doesn't seem to be called at all there though). Under similar circumstances, it seems that a Show Text can be ignored by the Player and/or RPG_RT (I have an hazy memory), would need more testing.

Ghabry commented 9 months ago

By looking at a savegame you can see that when it is crashing the event id of the foreground event (the one showing the msgbox) is 10.

When you do a teleport inside the foreground event the ID is 0.

When teleporting the event ID is normally set to 0 but it seems that when a parallel process does the teleport the event ID of the foreground event is not reset.

This will be very hard to replicate in the Player because we simply invoke a function during teleport that sets all IDs to 0. :D


Also seems to be a race condition because the two teleports override each other.

RPG_RT is just multithreading hell xD