mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 03:12:09 +01:00
Core/Misc: Fixing warnings detected by Visual Studio 2015 compiler
This commit is contained in:
@@ -733,7 +733,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, WorldPac
|
||||
{
|
||||
if (charTemplate->Level != 1)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
|
||||
stmt->setUInt8(0, uint8(charTemplate->Level));
|
||||
stmt->setUInt64(1, newChar.GetGUID().GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
@@ -1604,7 +1604,7 @@ void WorldSession::HandleCharCustomizeCallback(PreparedQueryResult result, World
|
||||
playerBytes2 &= ~0xFF;
|
||||
playerBytes2 |= customizeInfo->FacialHairStyleID;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_PLAYERBYTES);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_PLAYERBYTES);
|
||||
|
||||
stmt->setUInt8(0, customizeInfo->SexID);
|
||||
stmt->setUInt32(1, customizeInfo->SkinID | (uint32(customizeInfo->FaceID) << 8) | (uint32(customizeInfo->HairStyleID) << 16) | (uint32(customizeInfo->HairColorID) << 24));
|
||||
@@ -1639,16 +1639,16 @@ void WorldSession::HandleCharCustomizeCallback(PreparedQueryResult result, World
|
||||
GetAccountId(), GetRemoteAddress().c_str(), oldName.c_str(), customizeInfo->CharGUID.ToString().c_str(), customizeInfo->CharName.c_str());
|
||||
}
|
||||
|
||||
void WorldSession::HandleEquipmentSetSave(WorldPackets::EquipmentSet::SaveEquipmentSet& packet)
|
||||
void WorldSession::HandleEquipmentSetSave(WorldPackets::EquipmentSet::SaveEquipmentSet& saveEquipmentSet)
|
||||
{
|
||||
if (packet.Set.SetID >= MAX_EQUIPMENT_SET_INDEX) // client set slots amount
|
||||
if (saveEquipmentSet.Set.SetID >= MAX_EQUIPMENT_SET_INDEX) // client set slots amount
|
||||
return;
|
||||
|
||||
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
||||
{
|
||||
if (!(packet.Set.IgnoreMask & (1 << i)))
|
||||
if (!(saveEquipmentSet.Set.IgnoreMask & (1 << i)))
|
||||
{
|
||||
ObjectGuid const& itemGuid = packet.Set.Pieces[i];
|
||||
ObjectGuid const& itemGuid = saveEquipmentSet.Set.Pieces[i];
|
||||
|
||||
Item* item = _player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
|
||||
@@ -1661,37 +1661,37 @@ void WorldSession::HandleEquipmentSetSave(WorldPackets::EquipmentSet::SaveEquipm
|
||||
return;
|
||||
}
|
||||
else
|
||||
packet.Set.Pieces[i].Clear();
|
||||
saveEquipmentSet.Set.Pieces[i].Clear();
|
||||
}
|
||||
|
||||
packet.Set.IgnoreMask &= 0x7FFFF; /// clear invalid bits (i > EQUIPMENT_SLOT_END)
|
||||
saveEquipmentSet.Set.IgnoreMask &= 0x7FFFF; /// clear invalid bits (i > EQUIPMENT_SLOT_END)
|
||||
|
||||
_player->SetEquipmentSet(std::move(packet.Set));
|
||||
_player->SetEquipmentSet(std::move(saveEquipmentSet.Set));
|
||||
}
|
||||
|
||||
void WorldSession::HandleDeleteEquipmentSet(WorldPackets::EquipmentSet::DeleteEquipmentSet& packet)
|
||||
void WorldSession::HandleDeleteEquipmentSet(WorldPackets::EquipmentSet::DeleteEquipmentSet& deleteEquipmentSet)
|
||||
{
|
||||
_player->DeleteEquipmentSet(packet.ID);
|
||||
_player->DeleteEquipmentSet(deleteEquipmentSet.ID);
|
||||
}
|
||||
|
||||
void WorldSession::HandleUseEquipmentSet(WorldPackets::EquipmentSet::UseEquipmentSet& packet)
|
||||
void WorldSession::HandleUseEquipmentSet(WorldPackets::EquipmentSet::UseEquipmentSet& useEquipmentSet)
|
||||
{
|
||||
ObjectGuid ignoredItemGuid;
|
||||
ignoredItemGuid.SetRawValue(0, 1);
|
||||
|
||||
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
||||
{
|
||||
TC_LOG_DEBUG("entities.player.items", "%s: ContainerSlot: %u, Slot: %u", packet.Items[i].Item.ToString().c_str(), packet.Items[i].ContainerSlot, packet.Items[i].Slot);
|
||||
TC_LOG_DEBUG("entities.player.items", "%s: ContainerSlot: %u, Slot: %u", useEquipmentSet.Items[i].Item.ToString().c_str(), useEquipmentSet.Items[i].ContainerSlot, useEquipmentSet.Items[i].Slot);
|
||||
|
||||
// check if item slot is set to "ignored" (raw value == 1), must not be unequipped then
|
||||
if (packet.Items[i].Item == ignoredItemGuid)
|
||||
if (useEquipmentSet.Items[i].Item == ignoredItemGuid)
|
||||
continue;
|
||||
|
||||
// Only equip weapons in combat
|
||||
if (_player->IsInCombat() && i != EQUIPMENT_SLOT_MAINHAND && i != EQUIPMENT_SLOT_OFFHAND && i != EQUIPMENT_SLOT_RANGED)
|
||||
continue;
|
||||
|
||||
Item* item = _player->GetItemByGuid(packet.Items[i].Item);
|
||||
Item* item = _player->GetItemByGuid(useEquipmentSet.Items[i].Item);
|
||||
|
||||
uint16 dstPos = i | (INVENTORY_SLOT_BAG_0 << 8);
|
||||
|
||||
@@ -2057,8 +2057,8 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(PreparedQueryResult res
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(result->Fetch()[0].GetUInt64()))
|
||||
if (PreparedQueryResult memberResult = CharacterDatabase.Query(stmt))
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(memberResult->Fetch()[0].GetUInt64()))
|
||||
guild->DeleteMember(factionChangeInfo->Guid, false, false, true);
|
||||
|
||||
Player::LeaveAllArenaTeams(factionChangeInfo->Guid);
|
||||
@@ -2213,9 +2213,9 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(PreparedQueryResult res
|
||||
stmt->setUInt32(0, oldReputation);
|
||||
stmt->setUInt64(1, lowGuid);
|
||||
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
if (PreparedQueryResult reputationResult = CharacterDatabase.Query(stmt))
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
fields = reputationResult->Fetch();
|
||||
int32 oldDBRep = fields[0].GetInt32();
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(oldReputation);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user