Broken reading of a Save of The Sacred Tears TRUE #155

Closed
Zegeri opened this Issue Sep 20, 2015 · 3 comments

Projects

None yet

3 participants

@Zegeri
Member
Zegeri commented Sep 20, 2015

This save file shared by @carstene1ns for EasyRPG/Player#579 is incorrectly parsed:
http://f4ke.de/dev/easyrpg/TSTT/Save03.lsd

When run with _DEBUG, it'll warn about multiple skipped chunks and it'll crash because of running out of bytes. What breaks liblcf is a keyinput_variable (0x16) at 0x3846, inside the SaveEventData of the 8th CommonEvent.

16 01 8C 17 01 01

should be parsed as:

keyinput_variable (size 01) (value 8c)
keyinput_all_directions (size 01) (value 01)

But it's actually parsed as:

keyinput_variable (size 01) (value 8c 17)
[crap]

keyinput_variable saves the variable used by the last KeyInputProc. Here's the funny part. In this case, the last KeyInputProc saves the input value in the variable 908. Now: 908 = 0x038C. So keyinput_variable seems to be actually saving the last byte, not the whole number.

@fdelapena fdelapena added the Crash label Sep 20, 2015
@Ghabry
Member
Ghabry commented Sep 20, 2015

I can't even get the KeyInput in a simple test case to work.

Have an Auto Start Common Event that reads Left/Right and then Waits 1.0 second and a map event that changes its look based on the button. The look never changes :(

@Zegeri
Member
Zegeri commented Sep 20, 2015

That setup you've described works on my end. Try running it in TestPlay mode and looking at the table of variables during that second.

@Ghabry
Member
Ghabry commented Sep 20, 2015

Yeah the problem I encountered was a different bug

@Zegeri Zegeri added a commit to Zegeri/liblcf that referenced this issue Sep 23, 2015
@Zegeri Zegeri Make keyinput_variable an uint8_t (fixes #155) 565c281
@fdelapena fdelapena closed this in b9af522 Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment