Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(Core): fix few static analysis #20566

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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