refactor(Core): fix few static analysis (#20566)

* refactor(Core): fix few static analysis

* fix builds

* revert FacingInfo change and fix GraveYard ID use in a log
This commit is contained in:
Grimdhex
2024-11-24 21:02:32 +01:00
committed by GitHub
parent 8792cd38dc
commit 9874a47de5
3 changed files with 8 additions and 8 deletions

View File

@@ -217,7 +217,7 @@ void HostileReference::setOnlineOfflineState(bool isOnline)
{
iOnline = isOnline;
ThreatRefStatusChangeEvent event(UEV_THREAT_REF_ONLINE_STATUS, this);
ThreatRefStatusChangeEvent event(UEV_THREAT_REF_ONLINE_STATUS, this, isOnline);
fireStatusChanged(event);
}
}
@@ -230,7 +230,7 @@ void HostileReference::removeReference()
{
invalidate();
ThreatRefStatusChangeEvent event(UEV_THREAT_REF_REMOVE_FROM_LIST, this);
ThreatRefStatusChangeEvent event(UEV_THREAT_REF_REMOVE_FROM_LIST, this, false);
fireStatusChanged(event);
}

View File

@@ -46,11 +46,11 @@ void Graveyard::LoadGraveyardFromDB()
do
{
Field* fields = result->Fetch();
uint32 ID = fields[0].Get<uint32>();
GraveyardStruct Graveyard;
Field* fields = result->Fetch();
Graveyard.ID = fields[0].Get<uint32>();
Graveyard.Map = fields[1].Get<uint32>();
Graveyard.x = fields[2].Get<float>();
Graveyard.y = fields[3].Get<float>();
@@ -59,13 +59,13 @@ void Graveyard::LoadGraveyardFromDB()
if (!Utf8toWStr(Graveyard.name, Graveyard.wnameLow))
{
LOG_ERROR("sql.sql", "Wrong UTF8 name for id {} in `game_graveyard` table, ignoring.", ID);
LOG_ERROR("sql.sql", "Wrong UTF8 name for id {} in `game_graveyard` table, ignoring.", Graveyard.ID);
continue;
}
wstrToLower(Graveyard.wnameLow);
_graveyardStore[ID] = Graveyard;
_graveyardStore[Graveyard.ID] = std::move(Graveyard);
++Count;
} while (result->NextRow());

View File

@@ -476,7 +476,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
OpcodeHandler const* handler = opcodeTable[opcode];
if (!handler)
{
LOG_ERROR("network.opcode", "No defined handler for opcode {} sent by {}", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet.GetOpcode())), _worldSession->GetPlayerInfo());
LOG_ERROR("network.opcode", "No defined handler for opcode {} sent by {}", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packetToQueue->GetOpcode())), _worldSession->GetPlayerInfo());
delete packetToQueue;
return ReadDataHandlerResult::Error;
}