Skip to content

Commit

Permalink
refactor(Core): fix few static analysis (azerothcore#20566)
Browse files Browse the repository at this point in the history
* refactor(Core): fix few static analysis

* fix builds

* revert FacingInfo change and fix GraveYard ID use in a log
  • Loading branch information
Grimdhex authored Nov 24, 2024
1 parent 8792cd3 commit 9874a47
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/server/game/Combat/ThreatMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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);
}

Expand Down
10 changes: 5 additions & 5 deletions src/server/game/Misc/GameGraveyard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
Expand All @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Server/WorldSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9874a47

Please sign in to comment.