AM2R-Community-Developers/AM2R-Community-Updates

Display options crashes

Miepee opened this issue · 2 comments

// DISPLAY OPTIONS
// Fullscreen and scale should NOT exist on Android
if (os_type != os_android) {
opFullscreen = i++;
opScale = i++;
}
opVSync = i++;
opSensitivity = i++;
opWidescreen = i++;
// HUD
opShowHUD = i++;
opShowMap = i++;
opCounterStyle = i++;
// NOTIFICATIONS
opShowHints = i++;
opButtonType = i++;
opShowScans = i++;
opLanguage = i++;

These have been wrongly refactored.
The correct order should be this instead:

opVSync = i++
opShowHUD = i++
opShowMap = i++
opCounterStyle = i++
opShowHints = i++
opButtonType = i++
opShowScans = i++
opLanguage = i++
opSensitivity = i++
opWidescreen = i++

This does get rid of the organized order you currently have there, but fixes the crashes.

Other way to solve this, would be to refactor the whole oOptionsDisplay.

############################################################################################
FATAL ERROR in
action number 1
of Other Event: User Defined 2
for object oOptionsDisplay:

Unable to find any instance for object index '0' name 'oTestKeys'
at gml_Object_oOptionsDisplay_Other_12
############################################################################################

is the crash message.
Reason it crashes, is because op[opButtonType] results to 0 (the ID for oTestKeys) so it then tries to access oTestKeys.optext

I fixed this and committed but failed to mention the issue. Resolved.