Specifically ask for an integer from Lua for percentage
authorToni Spets <toni.spets@iki.fi>
Sat, 16 May 2009 17:37:53 +0000 (20:37 +0300)
committerToni Spets <toni.spets@iki.fi>
Sat, 16 May 2009 17:37:53 +0000 (20:37 +0300)
src/llua.c

index ee930fa..159105b 100644 (file)
@@ -118,7 +118,7 @@ int llua_getpercent(const char *args, int *per)
                if(!lua_isnumber(lua_L, -1)) {
                        ERR("llua_getpercent: function %s didn't return a number (percent), result discarded", func);
                } else {
-                       *per = lua_tonumber(lua_L, -1);
+                       *per = lua_tointeger(lua_L, -1);
                        lua_pop(lua_L, 1);
                        return 1;
                }