Fix anti-Stereo Mode remap check in Lua music remapping function.

This commit is contained in:
Freaky Mutant Man 2025-10-26 00:46:00 +00:00 committed by Eidolon
parent add76b17aa
commit 039ba6c3dc

View file

@ -489,7 +489,8 @@ static int lib_mMusicRemap(lua_State *L)
}
// Do not allow Lua to remap Stereo Mode tunes.
if (strncmp("stere", tune_id, 5))
if (strlen(tune_id) > 5
&& toupper(tune_id[0]) == 'S' && toupper(tune_id[1]) == 'T' && toupper(tune_id[2]) == 'E' && toupper(tune_id[3]) == 'R' && toupper(tune_id[4]) == 'E')
{
return LUA_ErrStereo(L, tune_id);
}