Add bugfix for the broken Waterway TSC script
This commit is contained in:
parent
541ec3695e
commit
e43160825e
1 changed files with 26 additions and 0 deletions
|
@ -898,6 +898,32 @@ int TextScriptProc(void)
|
||||||
x = GetTextScriptNo(gTS.p_read + 4);
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
z = GetTextScriptNo(gTS.p_read + 9);
|
z = GetTextScriptNo(gTS.p_read + 9);
|
||||||
|
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
// Some versions of the Waterway TSC script contain a bug:
|
||||||
|
// <FLJ850:0111
|
||||||
|
// This command *should* be...
|
||||||
|
// <FLJ0850:0111
|
||||||
|
// This bug causes the values to be misread as 8510 and 1075,
|
||||||
|
// leading to an out-of-bounds gFlagNPC access.
|
||||||
|
// As well as this, the out-of-bound read has a random chance
|
||||||
|
// of being true or false. If it's true, then the game will
|
||||||
|
// try to execute script 1075, causing a crash.
|
||||||
|
// To fix this, we manually catch this error and use the
|
||||||
|
// correct values.
|
||||||
|
// This bug is present in...
|
||||||
|
// Japanese 1.0.0.5 (and presumably earlier versions)
|
||||||
|
// Aeon Genesis 1.0.0.5
|
||||||
|
// Aeon Genesis 1.0.0.6
|
||||||
|
// Cave Story (WiiWare)
|
||||||
|
// Cave Story+ (Steam)
|
||||||
|
// Gee, I wonder how it snuck into the Nicalis ports. ¬_¬
|
||||||
|
if (!memcmp(&gTS.data[gTS.p_read + 4], "850:0111", 8))
|
||||||
|
{
|
||||||
|
x = 850;
|
||||||
|
z = 111;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (GetNPCFlag(x))
|
if (GetNPCFlag(x))
|
||||||
JumpTextScript(z);
|
JumpTextScript(z);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue