Index: binaries/data/mods/public/gui/gamesettings/attributes/GameSpeed.js =================================================================== --- binaries/data/mods/public/gui/gamesettings/attributes/GameSpeed.js +++ binaries/data/mods/public/gui/gamesettings/attributes/GameSpeed.js @@ -8,7 +8,7 @@ toInitAttributes(attribs) { - attribs.gameSpeed = this.gameSpeed; + attribs.gameSpeed = +this.gameSpeed; } fromInitAttributes(attribs) @@ -27,6 +27,6 @@ setSpeed(speed) { - this.gameSpeed = speed; + this.gameSpeed = +speed; } }; Index: binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Dropdowns/GameSpeed.js =================================================================== --- binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Dropdowns/GameSpeed.js +++ binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Dropdowns/GameSpeed.js @@ -25,17 +25,22 @@ break; } - if (this.previousAllowFastForward !== allowFastForward) + if (this.previousAllowFastForward === allowFastForward) { - this.previousAllowFastForward = allowFastForward; - let values = prepareForDropdown( - g_Settings.GameSpeeds.filter(speed => !speed.FastForward || allowFastForward)); - - this.dropdown.list = values.Title; - this.dropdown.list_data = values.Speed; + this.setSelectedValue(g_GameSettings.gameSpeed.gameSpeed); + return; } + this.previousAllowFastForward = allowFastForward; + let values = prepareForDropdown( + g_Settings.GameSpeeds.filter(speed => !speed.FastForward || allowFastForward)); + let currentSpeed = +this.dropdown.list_data?.[this.dropdown.selected]; + if (values.Speed.indexOf(currentSpeed) === -1) + this.dropdown.selected = values.Default; - this.setSelectedValue(g_GameSettings.gameSpeed.gameSpeed); + this.dropdown.list = values.Title; + this.dropdown.list_data = values.Speed; + + g_GameSettings.gameSpeed.setSpeed(this.dropdown.list_data[this.dropdown.selected]); } onSelectionChange(itemIdx) Index: source/ps/Game.cpp =================================================================== --- source/ps/Game.cpp +++ source/ps/Game.cpp @@ -221,8 +221,13 @@ scriptInterface.GetProperty(attribs, "mapType", mapType); float speed; - if (scriptInterface.HasProperty(attribs, "gameSpeed") && scriptInterface.GetProperty(attribs, "gameSpeed", speed)) - SetSimRate(speed); + if (scriptInterface.HasProperty(attribs, "gameSpeed")) + { + if (scriptInterface.GetProperty(attribs, "gameSpeed", speed)) + SetSimRate(speed); + else + LOGERROR("GameSpeed could not be parsed."); + } LDR_BeginRegistering();