Skip to content

Commit

Permalink
Mangos header file cleanup
Browse files Browse the repository at this point in the history
Probably more to do, but will have to be tested when Mangos can be updated
  • Loading branch information
Foereaper committed Mar 2, 2024
1 parent 3fbc870 commit 339e74d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions Mangos/ElunaQueryMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ namespace LuaQuery

const char* str = row[i].GetCString();
if (row[i].IsNull() || !str)
E->Push(E->L);
E->Push();
else
{
// MYSQL_TYPE_LONGLONG Interpreted as string for lua
Expand Down Expand Up @@ -340,7 +340,7 @@ namespace LuaQuery

const char* str = row[i].GetString();
if (row[i].IsNULL() || !str)
E->Push(E->L);
E->Push();
else
{
// MYSQL_TYPE_LONGLONG Interpreted as string for lua
Expand Down
58 changes: 29 additions & 29 deletions Mangos/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -1271,13 +1271,13 @@ namespace LuaGlobalFunctions
if (result)
E->Push(new ElunaQuery(result));
else
E->Push(E->L);
E->Push();
#else
ElunaQuery* result = WorldDatabase.QueryNamed(query);
if (result)
E->Push(result);
else
E->Push(E->L);
E->Push();
#endif
return 1;
}
Expand Down Expand Up @@ -1322,13 +1322,13 @@ namespace LuaGlobalFunctions
if (result)
E->Push(new QueryResult(result));
else
E->Push(E->L);
E->Push();
#else
QueryNamedResult* result = CharacterDatabase.QueryNamed(query);
if (result)
E->Push(result);
else
E->Push(E->L);
E->Push();
#endif
return 1;
}
Expand Down Expand Up @@ -1373,13 +1373,13 @@ namespace LuaGlobalFunctions
if (result)
E->Push(new QueryResult(result));
else
E->Push(E->L);
E->Push();
#else
QueryNamedResult* result = LoginDatabase.QueryNamed(query);
if (result)
E->Push(result);
else
E->Push(E->L);
E->Push();
#endif
return 1;
}
Expand Down Expand Up @@ -1521,7 +1521,7 @@ namespace LuaGlobalFunctions
uint32 phase = E->CHECKVAL<uint32>(11, PHASEMASK_NORMAL);
if (!phase)
{
E->Push(E->L);
E->Push();
return 1;
}
#endif
Expand All @@ -1530,7 +1530,7 @@ namespace LuaGlobalFunctions
Map* map = eMapMgr->FindMap(mapID, instanceID);
if (!map)
{
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1541,7 +1541,7 @@ namespace LuaGlobalFunctions
CreatureInfo const* cinfo = ObjectMgr::GetCreatureTemplate(entry);
if (!cinfo)
{
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1555,7 +1555,7 @@ namespace LuaGlobalFunctions
uint32 lowguid = eObjectMgr->GenerateStaticCreatureLowGuid();
if (!lowguid)
{
E->Push(E->L);
E->Push();
return 1;
}
#ifdef CMANGOS
Expand All @@ -1565,7 +1565,7 @@ namespace LuaGlobalFunctions
#endif
{
delete pCreature;
E->Push(E->L);
E->Push();
return 1;
}

Expand Down Expand Up @@ -1598,7 +1598,7 @@ namespace LuaGlobalFunctions
CreatureInfo const* cinfo = ObjectMgr::GetCreatureTemplate(entry);
if (!cinfo)
{
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1620,7 +1620,7 @@ namespace LuaGlobalFunctions
{
delete pCreature;
{
E->Push(E->L);
E->Push();
return 1;
}
}
Expand Down Expand Up @@ -1650,15 +1650,15 @@ namespace LuaGlobalFunctions
const GameObjectInfo* gInfo = ObjectMgr::GetGameObjectInfo(entry);
if (!gInfo)
{
E->Push(E->L);
E->Push();
return 1;
}

// used guids from specially reserved range (can be 0 if no free values)
uint32 db_lowGUID = eObjectMgr->GenerateStaticGameObjectLowGuid();
if (!db_lowGUID)
{
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1674,7 +1674,7 @@ namespace LuaGlobalFunctions
#endif
{
delete pGameObj;
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1698,7 +1698,7 @@ namespace LuaGlobalFunctions
#endif
{
delete pGameObj;
E->Push(E->L);
E->Push();
return 1;
}

Expand Down Expand Up @@ -1726,7 +1726,7 @@ namespace LuaGlobalFunctions
#endif
{
delete pGameObj;
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1743,7 +1743,7 @@ namespace LuaGlobalFunctions
Map* map = eMapMgr->FindMap(mapID, instanceID);
if (!map)
{
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1761,7 +1761,7 @@ namespace LuaGlobalFunctions
#endif
{
delete creature;
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1781,7 +1781,7 @@ namespace LuaGlobalFunctions
#endif
{
delete creature;
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1793,7 +1793,7 @@ namespace LuaGlobalFunctions
TempSummon* creature = map->SummonCreature(entry, pos, NULL, durorresptime);
if (!creature)
{
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1813,13 +1813,13 @@ namespace LuaGlobalFunctions
const GameObjectTemplate* objectInfo = eObjectMgr->GetGameObjectTemplate(entry);
if (!objectInfo)
{
E->Push(E->L);
E->Push();
return 1;
}

if (objectInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(objectInfo->displayId))
{
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1834,7 +1834,7 @@ namespace LuaGlobalFunctions
#endif
{
delete object;
E->Push(E->L);
E->Push();
return 1;
}

Expand All @@ -1860,7 +1860,7 @@ namespace LuaGlobalFunctions
#endif
{
delete object;
E->Push(E->L);
E->Push();
return 1;
}
#ifndef AZEROTHCORE
Expand All @@ -1875,7 +1875,7 @@ namespace LuaGlobalFunctions
return 1;
}
#endif
E->Push(E->L);
E->Push();
return 1;
}

Expand Down Expand Up @@ -2345,13 +2345,13 @@ namespace LuaGlobalFunctions
int start = lua_gettop(E->L);
int end = start;

E->Push(E->L);
E->Push();
// Stack: {nodes}, mountA, mountH, price, pathid, {nodes}, nil
while (lua_next(E->L, -2) != 0)
{
// Stack: {nodes}, mountA, mountH, price, pathid, {nodes}, key, value
luaL_checktype(E->L, -1, LUA_TTABLE);
E->Push(E->L);
E->Push();
// Stack: {nodes}, mountA, mountH, price, pathid, {nodes}, key, value, nil
while (lua_next(E->L, -2) != 0)
{
Expand Down
2 changes: 1 addition & 1 deletion Mangos/MapMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ namespace LuaMap
if (iAI)
E->PushInstanceData(iAI, false);
else
E->Push(E->L); // nil
E->Push(); // nil

return 1;
}
Expand Down
8 changes: 4 additions & 4 deletions VMangos/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ namespace LuaGlobalFunctions
lua_pushvalue(E->L, 3);
int functionRef = luaL_ref(E->L, LUA_REGISTRYINDEX);
if (functionRef >= 0)
return Eluna::GetEluna(E->L)->Register(E->L, regtype, id, ObjectGuid(), 0, ev, functionRef, shots);
return E->Register(regtype, id, ObjectGuid(), 0, ev, functionRef, shots);
else
luaL_argerror(E->L, 3, "unable to make a ref to function");
return 0;
Expand All @@ -510,7 +510,7 @@ namespace LuaGlobalFunctions
lua_pushvalue(E->L, 2);
int functionRef = luaL_ref(E->L, LUA_REGISTRYINDEX);
if (functionRef >= 0)
return Eluna::GetEluna(E->L)->Register(E->L, regtype, 0, ObjectGuid(), 0, ev, functionRef, shots);
return E->Register(regtype, 0, ObjectGuid(), 0, ev, functionRef, shots);
else
luaL_argerror(E->L, 2, "unable to make a ref to function");
return 0;
Expand All @@ -527,7 +527,7 @@ namespace LuaGlobalFunctions
lua_pushvalue(E->L, 4);
int functionRef = luaL_ref(E->L, LUA_REGISTRYINDEX);
if (functionRef >= 0)
return Eluna::GetEluna(E->L)->Register(E->L, regtype, 0, guid, instanceId, ev, functionRef, shots);
return E->Register(regtype, 0, guid, instanceId, ev, functionRef, shots);
else
luaL_argerror(E->L, 4, "unable to make a ref to function");
return 0;
Expand Down Expand Up @@ -1231,7 +1231,7 @@ namespace LuaGlobalFunctions
if (result)
E->Push(result);
else
E->Push(E->L);
E->Push();
return 1;
}

Expand Down

0 comments on commit 339e74d

Please sign in to comment.