summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaState.cpp14
-rw-r--r--src/Bindings/LuaState.h1
2 files changed, 14 insertions, 1 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 50ce04f7c..2f01d2d4f 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -1066,6 +1066,18 @@ void cLuaState::Push(double a_Value)
+void cLuaState::Push(float a_Value)
+{
+ ASSERT(IsValid());
+
+ tolua_pushnumber(m_LuaState, static_cast<double>(a_Value));
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
void cLuaState::Push(int a_Value)
{
ASSERT(IsValid());
@@ -1385,7 +1397,7 @@ bool cLuaState::GetStackValue(int a_StackPos, float & a_ReturnedVal)
{
if (lua_isnumber(m_LuaState, a_StackPos))
{
- a_ReturnedVal = static_cast<float>(tolua_tonumber(m_LuaState, a_StackPos, a_ReturnedVal));
+ a_ReturnedVal = static_cast<float>(tolua_tonumber(m_LuaState, a_StackPos, static_cast<double>(a_ReturnedVal)));
return true;
}
return false;
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h
index 9c97e96d4..67e6dade5 100644
--- a/src/Bindings/LuaState.h
+++ b/src/Bindings/LuaState.h
@@ -589,6 +589,7 @@ public:
void Push(cLuaTCPLink * a_TCPLink);
void Push(cLuaUDPEndpoint * a_UDPEndpoint);
void Push(double a_Value);
+ void Push(float a_Value);
void Push(int a_Value);
void Push(long a_Value);
void Push(const UInt32 a_Value);