mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 15:58:36 +00:00
Simplify error logging
This commit is contained in:
+8
-8
@@ -76,12 +76,12 @@ Entity::~Entity()
|
||||
Client *Entity::CastToClient()
|
||||
{
|
||||
if (this == 0x00) {
|
||||
Log(Logs::General, Logs::Error, "CastToClient error (nullptr)");
|
||||
LogError("CastToClient error (nullptr)");
|
||||
return 0;
|
||||
}
|
||||
#ifdef _EQDEBUG
|
||||
if (!IsClient()) {
|
||||
Log(Logs::General, Logs::Error, "CastToClient error (not client)");
|
||||
LogError("CastToClient error (not client)");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -93,7 +93,7 @@ NPC *Entity::CastToNPC()
|
||||
{
|
||||
#ifdef _EQDEBUG
|
||||
if (!IsNPC()) {
|
||||
Log(Logs::General, Logs::Error, "CastToNPC error (Not NPC)");
|
||||
LogError("CastToNPC error (Not NPC)");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -377,7 +377,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline)
|
||||
{
|
||||
if (*it == nullptr)
|
||||
{
|
||||
Log(Logs::General, Logs::Error, "nullptr group, %s:%i", fname, fline);
|
||||
LogError("nullptr group, [{}]:[{}]", fname, fline);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -540,12 +540,12 @@ void EntityList::MobProcess()
|
||||
zone->StartShutdownTimer();
|
||||
Group *g = GetGroupByMob(mob);
|
||||
if(g) {
|
||||
Log(Logs::General, Logs::Error, "About to delete a client still in a group.");
|
||||
LogError("About to delete a client still in a group");
|
||||
g->DelMember(mob);
|
||||
}
|
||||
Raid *r = entity_list.GetRaidByClient(mob->CastToClient());
|
||||
if(r) {
|
||||
Log(Logs::General, Logs::Error, "About to delete a client still in a raid.");
|
||||
LogError("About to delete a client still in a raid");
|
||||
r->MemberZoned(mob->CastToClient());
|
||||
}
|
||||
entity_list.RemoveClient(id);
|
||||
@@ -817,7 +817,7 @@ void EntityList::CheckSpawnQueue()
|
||||
auto it = npc_list.find(ns->spawn.spawnId);
|
||||
if (it == npc_list.end()) {
|
||||
// We must of despawned, hope that's the reason!
|
||||
Log(Logs::General, Logs::Error, "Error in EntityList::CheckSpawnQueue: Unable to find NPC for spawnId '%u'", ns->spawn.spawnId);
|
||||
LogError("Error in EntityList::CheckSpawnQueue: Unable to find NPC for spawnId [{}]", ns->spawn.spawnId);
|
||||
}
|
||||
else {
|
||||
NPC *pnpc = it->second;
|
||||
@@ -2877,7 +2877,7 @@ char *EntityList::MakeNameUnique(char *name)
|
||||
return name;
|
||||
}
|
||||
}
|
||||
Log(Logs::General, Logs::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name);
|
||||
LogError("Fatal error in EntityList::MakeNameUnique: Unable to find unique name for [{}]", name);
|
||||
char tmp[64] = "!";
|
||||
strn0cpy(&tmp[1], name, sizeof(tmp) - 1);
|
||||
strcpy(name, tmp);
|
||||
|
||||
Reference in New Issue
Block a user