Gamesetup: make sure GameSpeed is a number

The dropdown converted the numbers to string, and the code expected
numbers.

Differential Revision: https://code.wildfiregames.com/D3924
This was SVN commit r25376.
This commit is contained in:
wraitii
2021-05-04 13:59:30 +00:00
parent cdd75deafb
commit 911f49c655
3 changed files with 29 additions and 12 deletions
+7 -2
View File
@@ -221,8 +221,13 @@ void CGame::RegisterInit(const JS::HandleValue attribs, const std::string& saved
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();