Core: Fix more warnings
--HG-- branch : trunk
This commit is contained in:
@@ -682,7 +682,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
|
||||
// send new char string if not empty
|
||||
if (!sWorld.GetNewCharString().empty())
|
||||
chH.PSendSysMessage(sWorld.GetNewCharString().c_str());
|
||||
chH.PSendSysMessage("%s", sWorld.GetNewCharString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1032,7 +1032,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
|
||||
recv_data >> SplitedAmount;
|
||||
}
|
||||
|
||||
if (BankTabSlot >= GUILD_BANK_MAX_SLOTS && BankTabSlot != 0xFF ||
|
||||
if ((BankTabSlot >= GUILD_BANK_MAX_SLOTS && BankTabSlot != 0xFF) ||
|
||||
BankTab >= pGuild->GetPurchasedTabs())
|
||||
{
|
||||
recv_data.rpos(recv_data.wpos()); // prevent additional spam at rejected packet
|
||||
|
||||
@@ -746,7 +746,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data)
|
||||
return;
|
||||
|
||||
// prevent resurrect before 30-sec delay after body release not finished
|
||||
if (corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP) > time_t(time(NULL)))
|
||||
if (time_t(corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP)) > time_t(time(NULL)))
|
||||
return;
|
||||
|
||||
if (!corpse->IsWithinDistInMap(GetPlayer(), CORPSE_RECLAIM_RADIUS, true))
|
||||
@@ -1421,7 +1421,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data)
|
||||
_player->SetSeer(_player);
|
||||
break;
|
||||
case 1:
|
||||
sLog.outDebug("Added FarSight " I64FMT " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow());
|
||||
sLog.outDebug("Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow());
|
||||
if (WorldObject *target = _player->GetViewpoint())
|
||||
_player->SetSeer(target);
|
||||
else
|
||||
|
||||
@@ -499,21 +499,23 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
|
||||
recv_data >> guid;
|
||||
|
||||
if (GetPlayer()->IsInWorld())
|
||||
if (Unit *mover = ObjectAccessor::GetUnit(*GetPlayer(), guid))
|
||||
{
|
||||
GetPlayer()->SetMover(mover);
|
||||
if (mover != GetPlayer() && mover->canFly())
|
||||
{
|
||||
WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
|
||||
data.append(mover->GetPackGUID());
|
||||
data << uint32(0);
|
||||
SendPacket(&data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, guid, _player->m_mover->GetGUID());
|
||||
GetPlayer()->SetMover(GetPlayer());
|
||||
if (Unit *mover = ObjectAccessor::GetUnit(*GetPlayer(), guid))
|
||||
{
|
||||
GetPlayer()->SetMover(mover);
|
||||
if (mover != GetPlayer() && mover->canFly())
|
||||
{
|
||||
WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
|
||||
data.append(mover->GetPackGUID());
|
||||
data << uint32(0);
|
||||
SendPacket(&data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, guid, _player->m_mover->GetGUID());
|
||||
GetPlayer()->SetMover(GetPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,7 +655,7 @@ void WorldSession::HandleEjectPasenger(WorldPacket &data)
|
||||
{
|
||||
if (data.GetOpcode() == CMSG_EJECT_PASSENGER)
|
||||
{
|
||||
if (Vehicle* Vv= _player->GetVehicleKit())
|
||||
if (_player->GetVehicleKit())
|
||||
{
|
||||
uint64 guid;
|
||||
data >> guid;
|
||||
|
||||
@@ -569,7 +569,7 @@ void WorldSession::SendStablePetCallback(QueryResult_AutoPtr result, uint64 guid
|
||||
while (result->NextRow());
|
||||
}
|
||||
|
||||
data.put<uint8>(sizeof(uint64), num); // set real data to placeholder
|
||||
data.put<uint8>(wpos, num); // set real data to placeholder
|
||||
SendPacket(&data);
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ void WorldSession::HandleDismissCritter(WorldPacket &recv_data)
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
sLog.outDebug("WORLD: Received CMSG_DISMISS_CRITTER for GUID %u", guid);
|
||||
sLog.outDebug("WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD "", guid);
|
||||
|
||||
Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GM_Ticket *ticket = sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()))
|
||||
if (sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()))
|
||||
{
|
||||
WorldPacket data(SMSG_GMTICKET_CREATE, 4);
|
||||
data << uint32(GMTICKET_RESPONSE_FAILURE); // You already have GM ticket
|
||||
@@ -291,7 +291,7 @@ void WorldSession::HandleReportLag(WorldPacket& recv_data)
|
||||
CharacterDatabase.Execute(os.str().c_str());
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMResponseResolve(WorldPacket& recvPacket)
|
||||
void WorldSession::HandleGMResponseResolve(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
// empty packet
|
||||
GM_Ticket* ticket = sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||
|
||||
@@ -92,8 +92,6 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/)
|
||||
data << uint32(view_trade->GetMoney()); // trader gold
|
||||
data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item
|
||||
|
||||
Item *item = NULL;
|
||||
|
||||
for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i)
|
||||
{
|
||||
data << uint8(i); // trade slot number, if not specified, then end of packet
|
||||
@@ -327,7 +325,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
|
||||
Item* castItem = my_trade->GetSpellCastItem();
|
||||
|
||||
if (!spellEntry || !his_trade->GetItem(TRADE_SLOT_NONTRADED) ||
|
||||
my_trade->HasSpellCastItem() && !castItem)
|
||||
(my_trade->HasSpellCastItem() && !castItem))
|
||||
{
|
||||
clearAcceptTradeMode(my_trade, his_trade);
|
||||
clearAcceptTradeMode(myItems, hisItems);
|
||||
@@ -361,7 +359,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
|
||||
SpellEntry const* spellEntry = sSpellStore.LookupEntry(his_spell_id);
|
||||
Item* castItem = his_trade->GetSpellCastItem();
|
||||
|
||||
if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || his_trade->HasSpellCastItem() && !castItem)
|
||||
if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || (his_trade->HasSpellCastItem() && !castItem))
|
||||
{
|
||||
delete my_spell;
|
||||
his_trade->SetSpell(0);
|
||||
|
||||
Reference in New Issue
Block a user