EasyRPG / Player

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

ErasePicture + MovePicture right after will crash EasyRPG player #3189

Closed florianessl closed 5 months ago

florianessl commented 7 months ago

PictureEraseMoveCrash.zip

This wasn't an issue with 0.8 but the current nightly build of the EasyRPG Player.exe will crash in this case.

If a Picture (or StringPicture) id is erased and a MovePicture command is executed for the erased id, Player.exe will crash without any message and will create a dumpfile. RPG_RT just ignores the command.

I have broken down the problematic script to a few commands and attached a sample project.

florianessl commented 7 months ago

I think I found the problematic piece of code here: https://github.com/EasyRPG/Player/commit/e7c6e4161cc507a8f1cf66b825b41776d27bc9d5

In my fork, I just reverted these function calls back to Sprite.GetWidth() & Sprite.GetHeight() in case the spritesheet condition fails. There might be a better fix but I didn't read through most of the code because this one isn't really my area... https://github.com/VampiresDawnCommunity/Player/commit/ca68df9f0b9db01d17849f5ad7ced4cae336fb88

Ghabry commented 6 months ago

I think this will only crash when the picture has an origin configured (Maniac extension, origin != center). Will fix it. thanks.