Fix messing up optional args and a warning

This commit is contained in:
Rochet2
2014-12-19 17:41:34 +02:00
parent 5e27ac24aa
commit 517685f65d
2 changed files with 5 additions and 5 deletions

View File

@@ -476,11 +476,11 @@ namespace LuaGlobalFunctions
uint32 entry = Eluna::CHECKVAL<uint32>(L, 1);
uint32 ev = Eluna::CHECKVAL<uint32>(L, 2);
luaL_checktype(L, 3, LUA_TFUNCTION);
lua_pushvalue(L, 3);
uint32 shots = Eluna::CHECKVAL<uint32>(L, 4, 0);
lua_pushvalue(L, 3);
int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (luaL_ref(L, LUA_REGISTRYINDEX) >= 0)
if (functionRef >= 0)
E->Register(regtype, entry, ev, functionRef, shots);
else
luaL_argerror(L, 3, "unable to make a ref to function");
@@ -490,11 +490,11 @@ namespace LuaGlobalFunctions
{
uint32 ev = Eluna::CHECKVAL<uint32>(L, 1);
luaL_checktype(L, 2, LUA_TFUNCTION);
lua_pushvalue(L, 2);
uint32 shots = Eluna::CHECKVAL<uint32>(L, 3, 0);
lua_pushvalue(L, 2);
int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (luaL_ref(L, LUA_REGISTRYINDEX) >= 0)
if (functionRef >= 0)
E->Register(regtype, 0, ev, functionRef, shots);
else
luaL_argerror(L, 2, "unable to make a ref to function");

View File

@@ -204,7 +204,7 @@ namespace LuaItem
//if (!test.empty())
//{
name += ' ';
name += suffix[(name != temp->Name1) ? locale : DEFAULT_LOCALE];
name += suffix[(name != temp->Name1) ? locale : uint8(DEFAULT_LOCALE)];
/*}*/
}
}