Commits

Alex Ames  committed 6d45dd4

Added luaU_pushenum

  • Participants
  • Parent commits 4b4217e

Comments (0)

Files changed (1)

File LuaWrapperUtil.hpp

 template <typename T>
 void luaU_setenum(lua_State* L, int index, const char* key, T value)
 {
-    lua_pushnumber(L, value);
+    lua_pushnumber(L, static_cast<int>(value));
     lua_setfield(L, luaW_correctindex(L, index, 1), key);
 }
 
 }
 
 template <typename T>
+void luaU_pushenum(lua_State* L, T value)
+{
+    lua_pushnumber(L, static_cast<int>(value));
+}
+
+template <typename T>
 T luaU_checkenum(lua_State* L, int index)
 {
     return static_cast<T>(luaL_checkinteger(L, index));