From bbe7042b2d86809c544313a3b22737dd4d0ffaff Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 19 Sep 2013 07:12:48 +0000 Subject: [PATCH] fixed loading scenario to read lua number as a float --- source/shared_lib/sources/lua/lua_script.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/shared_lib/sources/lua/lua_script.cpp b/source/shared_lib/sources/lua/lua_script.cpp index d1ecc90e..7eb56079 100644 --- a/source/shared_lib/sources/lua/lua_script.cpp +++ b/source/shared_lib/sources/lua/lua_script.cpp @@ -421,7 +421,7 @@ void LuaScript::loadGame(const XmlNode *rootNode) { lua_pushstring( luaState, node->getAttribute("value")->getValue().c_str() ); break; case LUA_TNUMBER: - lua_pushnumber( luaState, node->getAttribute("value")->getIntValue() ); + lua_pushnumber( luaState, node->getAttribute("value")->getFloatValue() ); break; case LUA_TBOOLEAN: lua_pushboolean( luaState, node->getAttribute("value")->getBoolValue() ); @@ -439,7 +439,7 @@ void LuaScript::loadGame(const XmlNode *rootNode) { lua_pushstring( luaState, nodeTable->getAttribute("key")->getValue().c_str() ); break; case LUA_TNUMBER: - lua_pushnumber( luaState, nodeTable->getAttribute("key")->getIntValue() ); + lua_pushnumber( luaState, nodeTable->getAttribute("key")->getFloatValue() ); break; case LUA_TBOOLEAN: lua_pushboolean( luaState, nodeTable->getAttribute("key")->getIntValue() ); @@ -451,7 +451,7 @@ void LuaScript::loadGame(const XmlNode *rootNode) { lua_pushstring( luaState, nodeTable->getAttribute("value")->getValue().c_str() ); break; case LUA_TNUMBER: - lua_pushnumber( luaState, nodeTable->getAttribute("value")->getIntValue() ); + lua_pushnumber( luaState, nodeTable->getAttribute("value")->getFloatValue() ); break; case LUA_TBOOLEAN: lua_pushboolean( luaState, nodeTable->getAttribute("value")->getIntValue() );