mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-17 21:50:50 -04:00
Core: Fix compile (Thanks to Sovak for reporting). Remove many warnings and Fix possible out of bounds access to Void storage
This commit is contained in:
@@ -1825,6 +1825,26 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type,
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_GUILD:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILLS_GUILD:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ARCHAEOLOGY_PROJECTS:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK118:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK120:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK121:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK122:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK123:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK137:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK138:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK139:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK140:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK141:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK142:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK143:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK144:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK145:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK146:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK147:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK148:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK149:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_UNK150:
|
||||
break; // Not implemented yet :(
|
||||
}
|
||||
|
||||
|
||||
@@ -333,6 +333,8 @@ class AchievementGlobalMgr
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2: // NYI
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_BATTLEGROUND: // NYI
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -699,7 +699,7 @@ void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint
|
||||
*data << channelName;
|
||||
*data << uint64(target_guid);
|
||||
}
|
||||
else if (type == CHAT_MSG_ADDON)
|
||||
else if (type == uint8(CHAT_MSG_ADDON))
|
||||
{
|
||||
ASSERT(addonPrefix);
|
||||
*data << addonPrefix;
|
||||
|
||||
@@ -1867,7 +1867,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B
|
||||
float y = fields[11].GetFloat();
|
||||
float z = fields[12].GetFloat();
|
||||
uint32 guildId = fields[13].GetUInt32();
|
||||
ObjectGuid guildGuid = MAKE_NEW_GUID(guildId, 0, guildId ? HIGHGUID_GUILD : 0);
|
||||
ObjectGuid guildGuid = MAKE_NEW_GUID(guildId, 0, guildId ? uint32(HIGHGUID_GUILD) : 0);
|
||||
uint32 playerFlags = fields[14].GetUInt32();
|
||||
uint32 atLoginFlags = fields[15].GetUInt16();
|
||||
Tokens equipment(fields[19].GetString(), ' ');
|
||||
@@ -7394,7 +7394,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/)
|
||||
// if we change total, we must change week
|
||||
ASSERT(((newTotalCount-oldTotalCount) != 0) == ((newWeekCount-oldWeekCount) != 0));
|
||||
|
||||
if (newTotalCount != oldTotalCount)
|
||||
if (uint32(newTotalCount) != oldTotalCount)
|
||||
{
|
||||
if (itr->second.state != PLAYERCURRENCY_NEW)
|
||||
itr->second.state = PLAYERCURRENCY_CHANGED;
|
||||
@@ -17584,25 +17584,25 @@ void Player::_LoadVoidStorage(PreparedQueryResult result)
|
||||
|
||||
if (!itemId)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid id (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry);
|
||||
sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid id (item id: " UI64FMTD ", entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!sObjectMgr->GetItemTemplate(itemEntry))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid entry (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry);
|
||||
sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid entry (item id: " UI64FMTD ", entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT)
|
||||
if (slot >= VOID_STORAGE_MAX_SLOT)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, slot);
|
||||
sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid slot (item id: " UI64FMTD ", entry: %u, slot: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!sObjectMgr->GetPlayerByLowGUID(creatorGuid))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid creator guid, set to 0 (item id: %u, entry: %u, creatorGuid: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, creatorGuid);
|
||||
sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid creator guid, set to 0 (item id: " UI64FMTD ", entry: %u, creatorGuid: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, creatorGuid);
|
||||
creatorGuid = 0;
|
||||
}
|
||||
|
||||
@@ -25710,7 +25710,7 @@ uint8 Player::GetNextVoidStorageFreeSlot() const
|
||||
if (!_voidStorageItems[i]) // unused item
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
return VOID_STORAGE_MAX_SLOT;
|
||||
}
|
||||
|
||||
uint8 Player::GetNumOfVoidStorageFreeSlots() const
|
||||
@@ -25726,9 +25726,9 @@ uint8 Player::GetNumOfVoidStorageFreeSlots() const
|
||||
|
||||
uint8 Player::AddVoidStorageItem(const VoidStorageItem& item)
|
||||
{
|
||||
uint8 slot = GetNextVoidStorageFreeSlot();
|
||||
int8 slot = GetNextVoidStorageFreeSlot();
|
||||
|
||||
if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT)
|
||||
if (slot >= VOID_STORAGE_MAX_SLOT)
|
||||
{
|
||||
GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL);
|
||||
return -1;
|
||||
@@ -25741,7 +25741,7 @@ uint8 Player::AddVoidStorageItem(const VoidStorageItem& item)
|
||||
|
||||
void Player::AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item)
|
||||
{
|
||||
if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT)
|
||||
if (slot >= VOID_STORAGE_MAX_SLOT)
|
||||
{
|
||||
GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL);
|
||||
return;
|
||||
@@ -25749,7 +25749,7 @@ void Player::AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item)
|
||||
|
||||
if (_voidStorageItems[slot])
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Player::AddVoidStorageItemAtSlot - Player (GUID: %u, name: %s) tried to add an item to an used slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), _voidStorageItems[slot]->ItemId, _voidStorageItems[slot]->ItemEntry, slot);
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Player::AddVoidStorageItemAtSlot - Player (GUID: %u, name: %s) tried to add an item to an used slot (item id: " UI64FMTD ", entry: %u, slot: %u).", GetGUIDLow(), GetName(), _voidStorageItems[slot]->ItemId, _voidStorageItems[slot]->ItemEntry, slot);
|
||||
GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1);
|
||||
return;
|
||||
}
|
||||
@@ -25760,7 +25760,7 @@ void Player::AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item)
|
||||
|
||||
void Player::DeleteVoidStorageItem(uint8 slot)
|
||||
{
|
||||
if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT)
|
||||
if (slot >= VOID_STORAGE_MAX_SLOT)
|
||||
{
|
||||
GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1);
|
||||
return;
|
||||
@@ -25772,7 +25772,7 @@ void Player::DeleteVoidStorageItem(uint8 slot)
|
||||
|
||||
bool Player::SwapVoidStorageItem(uint8 oldSlot, uint8 newSlot)
|
||||
{
|
||||
if (oldSlot < 0 || oldSlot > VOID_STORAGE_MAX_SLOT || newSlot < 0 || newSlot > VOID_STORAGE_MAX_SLOT || oldSlot == newSlot)
|
||||
if (oldSlot >= VOID_STORAGE_MAX_SLOT || newSlot >= VOID_STORAGE_MAX_SLOT || oldSlot == newSlot)
|
||||
return false;
|
||||
|
||||
std::swap(_voidStorageItems[newSlot], _voidStorageItems[oldSlot]);
|
||||
@@ -25781,7 +25781,7 @@ bool Player::SwapVoidStorageItem(uint8 oldSlot, uint8 newSlot)
|
||||
|
||||
VoidStorageItem* Player::GetVoidStorageItem(uint8 slot) const
|
||||
{
|
||||
if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT)
|
||||
if (slot >= VOID_STORAGE_MAX_SLOT)
|
||||
{
|
||||
GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1);
|
||||
return NULL;
|
||||
|
||||
@@ -599,6 +599,8 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
|
||||
case BASE_ATTACK:
|
||||
RewardRage(rage, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2142,7 +2144,7 @@ void Unit::SendMeleeAttackStop(Unit* victim)
|
||||
sLog->outInfo(LOG_FILTER_UNITS, "%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow());
|
||||
}
|
||||
|
||||
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType)
|
||||
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType /*attackType*/)
|
||||
{
|
||||
// These spells can't be blocked
|
||||
if (spellProto && spellProto->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)
|
||||
@@ -4978,7 +4980,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEf
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
|
||||
bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 /*procEx*/, uint32 cooldown)
|
||||
{
|
||||
// Get triggered aura spell info
|
||||
SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo();
|
||||
@@ -5025,7 +5027,7 @@ bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect*
|
||||
if (m_extraAttacks && triggerEntry->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
|
||||
return false;
|
||||
|
||||
if (powerRequired == NULL || powerAmountRequired == NULL)
|
||||
if (!powerRequired || !powerAmountRequired)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unit::HandleAuraProcOnPowerAmount: Spell %u have 0 powerAmountRequired in EffectAmount[%d] or 0 powerRequired in EffectMiscValue, not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
|
||||
return false;
|
||||
@@ -7028,7 +7030,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
if (dummySpell->SpellIconID == 3059)
|
||||
{
|
||||
// Lightning Shield
|
||||
if (AuraEffect const* aurEff = GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0))
|
||||
if (GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0))
|
||||
{
|
||||
uint32 spell = 26364;
|
||||
|
||||
@@ -7312,7 +7314,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit* victim, uint32 /*damage*/, Aura
|
||||
|
||||
// Used in case when access to whole aura is needed
|
||||
// All procs should be handled like this...
|
||||
bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 procEx, uint32 cooldown, bool * handled)
|
||||
bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown, bool * handled)
|
||||
{
|
||||
SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo();
|
||||
|
||||
@@ -7864,7 +7866,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
{
|
||||
// Item - Death Knight T10 Melee 4P Bonus
|
||||
else if (auraSpellInfo->Id == 70656)
|
||||
if (auraSpellInfo->Id == 70656)
|
||||
{
|
||||
if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT)
|
||||
return false;
|
||||
@@ -8207,7 +8209,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown)
|
||||
bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* /*procSpell*/, uint32 cooldown)
|
||||
{
|
||||
int32 scriptId = triggeredByAura->GetMiscValue();
|
||||
|
||||
@@ -10047,7 +10049,7 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage
|
||||
return crit_bonus;
|
||||
}
|
||||
|
||||
uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim)
|
||||
uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* /*spellProto*/, uint32 damage, Unit* victim)
|
||||
{
|
||||
// Calculate critical bonus
|
||||
int32 crit_bonus = damage;
|
||||
|
||||
@@ -231,9 +231,9 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke
|
||||
}
|
||||
|
||||
ObjectMgr::ObjectMgr(): _auctionId(1), _equipmentSetGuid(1),
|
||||
_itemTextId(1), _mailId(1), _hiPetNumber(1), _hiCharGuid(1),
|
||||
_itemTextId(1), _mailId(1), _hiPetNumber(1), _voidItemId(1), _hiCharGuid(1),
|
||||
_hiCreatureGuid(1), _hiPetGuid(1), _hiVehicleGuid(1), _hiItemGuid(1),
|
||||
_hiGoGuid(1), _hiDoGuid(1), _hiCorpseGuid(1), _hiMoTransGuid(1), _voidItemId(1)
|
||||
_hiGoGuid(1), _hiDoGuid(1), _hiCorpseGuid(1), _hiMoTransGuid(1)
|
||||
{}
|
||||
|
||||
ObjectMgr::~ObjectMgr()
|
||||
@@ -8259,7 +8259,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount
|
||||
return false;
|
||||
}
|
||||
|
||||
if (vItems->GetItemCount() >= MAX_VENDOR_ITEMS)
|
||||
if (vItems->GetItemCount() >= MAX_VENDOR_ITEMS) // FIXME: GetItemCount range 0...255 MAX_VENDOR_ITEMS = 300
|
||||
{
|
||||
if (player)
|
||||
ChatHandler(player).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS);
|
||||
|
||||
@@ -1551,7 +1551,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name)
|
||||
data << uint32(m_emblemInfo.GetBackgroundColor());
|
||||
data << uint32(m_emblemInfo.GetColor());
|
||||
|
||||
ObjectGuid oldGuildGuid = MAKE_NEW_GUID(pInvitee->GetGuildId(), 0, pInvitee->GetGuildId() ? HIGHGUID_GUILD : 0);
|
||||
ObjectGuid oldGuildGuid = MAKE_NEW_GUID(pInvitee->GetGuildId(), 0, pInvitee->GetGuildId() ? uint32(HIGHGUID_GUILD) : 0);
|
||||
ObjectGuid newGuildGuid = GetGUID();
|
||||
|
||||
data.WriteBit(newGuildGuid[3]);
|
||||
@@ -1814,7 +1814,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount)
|
||||
if (!AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog->outCommand(player->GetSession()->GetAccountId(),
|
||||
"GM %s (Account: %u) deposit money (Amount: " UI64FMTD ") to guild bank (Guild ID %u)",
|
||||
"GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)",
|
||||
player->GetName(), player->GetSession()->GetAccountId(), amount, m_id);
|
||||
}
|
||||
// Log guild bank event
|
||||
|
||||
@@ -575,6 +575,8 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData)
|
||||
prefix = recvData.ReadString(prefixLen);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Logging enabled?
|
||||
|
||||
@@ -324,7 +324,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
|
||||
if (money > 0 && !AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: %u to player: %s (Account: %u)",
|
||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: " UI64FMTD " to player: %s (Account: %u)",
|
||||
GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account);
|
||||
}
|
||||
}
|
||||
@@ -519,7 +519,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData)
|
||||
if (!sObjectMgr->GetPlayerNameByGUID(sender_guid, sender_name))
|
||||
sender_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||
}
|
||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)",
|
||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: " UI64FMTD " to player: %s (Account: %u)",
|
||||
GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId);
|
||||
}
|
||||
else if (!receive)
|
||||
|
||||
@@ -48,7 +48,7 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
|
||||
{
|
||||
if (TalentTabEntry const* talentTabEntry = sTalentTabStore.LookupEntry(_player->GetPrimaryTalentTree(_player->GetActiveSpec())))
|
||||
{
|
||||
if (talentTabEntry->tabpage != tabPage)
|
||||
if (talentTabEntry->tabpage != uint32(tabPage))
|
||||
{
|
||||
recvPacket.rfinish();
|
||||
return;
|
||||
|
||||
@@ -523,14 +523,14 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
if (!AccountMgr::IsPlayerAccount(_player->GetSession()->GetSecurity()) && my_trade->GetMoney() > 0)
|
||||
{
|
||||
sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)",
|
||||
sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: " UI64FMTD ") to player: %s (Account: %u)",
|
||||
_player->GetName(), _player->GetSession()->GetAccountId(),
|
||||
my_trade->GetMoney(),
|
||||
trader->GetName(), trader->GetSession()->GetAccountId());
|
||||
}
|
||||
if (!AccountMgr::IsPlayerAccount(trader->GetSession()->GetSecurity()) && his_trade->GetMoney() > 0)
|
||||
{
|
||||
sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)",
|
||||
sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: " UI64FMTD ") to player: %s (Account: %u)",
|
||||
trader->GetName(), trader->GetSession()->GetAccountId(),
|
||||
his_trade->GetMoney(),
|
||||
_player->GetName(), _player->GetSession()->GetAccountId());
|
||||
|
||||
@@ -332,7 +332,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData)
|
||||
Item* item = player->GetItemByGuid(*itr);
|
||||
if (!item)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit an invalid item (item guid: %u).", player->GetGUIDLow(), player->GetName(), uint64(*itr));
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit an invalid item (item guid: " UI64FMTD ").", player->GetGUIDLow(), player->GetName(), uint64(*itr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData)
|
||||
VoidStorageItem* itemVS = player->GetVoidStorageItem(*itr, slot);
|
||||
if (!itemVS)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) tried to withdraw an invalid item (id: %u)", player->GetGUIDLow(), player->GetName(), uint64(*itr));
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) tried to withdraw an invalid item (id: " UI64FMTD ")", player->GetGUIDLow(), player->GetName(), uint64(*itr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData)
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INVENTORY_FULL);
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) couldn't withdraw item id %u because inventory was full.", player->GetGUIDLow(), player->GetName(), uint64(*itr));
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) couldn't withdraw item id " UI64FMTD " because inventory was full.", player->GetGUIDLow(), player->GetName(), uint64(*itr));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ void WorldSession::HandleVoidSwapItem(WorldPacket& recvData)
|
||||
uint8 oldSlot;
|
||||
if (!player->GetVoidStorageItem(itemId, oldSlot))
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) requested swapping an invalid item (slot: %u, itemid: %u).", player->GetGUIDLow(), player->GetName(), newSlot, uint64(itemId));
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) requested swapping an invalid item (slot: %u, itemid: " UI64FMTD ").", player->GetGUIDLow(), player->GetName(), newSlot, uint64(itemId));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -6613,7 +6613,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
|
||||
}
|
||||
|
||||
// don't regen when permanent aura target has full power
|
||||
if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType))
|
||||
if (GetBase()->IsPermanent() && uint32(target->GetPower(powerType)) == target->GetMaxPower(powerType))
|
||||
return;
|
||||
|
||||
// ignore negative values (can be result apply spellmods to aura damage
|
||||
@@ -6644,7 +6644,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
|
||||
}
|
||||
|
||||
// don't regen when permanent aura target has full power
|
||||
if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType))
|
||||
if (GetBase()->IsPermanent() && uint32(target->GetPower(powerType)) == target->GetMaxPower(powerType))
|
||||
return;
|
||||
|
||||
// ignore negative values (can be result apply spellmods to aura damage
|
||||
|
||||
@@ -5874,7 +5874,7 @@ SpellCastResult Spell::CheckItems()
|
||||
}
|
||||
|
||||
Powers power = Powers(m_spellInfo->Effects[i].MiscValue);
|
||||
if (m_targets.GetUnitTarget()->GetPower(power) == m_targets.GetUnitTarget()->GetMaxPower(power))
|
||||
if (uint32(m_targets.GetUnitTarget()->GetPower(power)) == m_targets.GetUnitTarget()->GetMaxPower(power))
|
||||
{
|
||||
failReason = SPELL_FAILED_ALREADY_AT_FULL_POWER;
|
||||
continue;
|
||||
|
||||
@@ -769,7 +769,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_int_configs[CONFIG_START_PLAYER_MONEY] = ConfigMgr::GetIntDefault("StartPlayerMoney", 0);
|
||||
if (int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) < 0)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SERVER_LOADING, "StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0);
|
||||
sLog->outError(LOG_FILTER_SERVER_LOADING, "StartPlayerMoney (%i) must be in range 0.." UI64FMTD ". Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0);
|
||||
m_int_configs[CONFIG_START_PLAYER_MONEY] = 0;
|
||||
}
|
||||
else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > 0x7FFFFFFF-1) // TODO: (See MAX_MONEY_AMOUNT)
|
||||
@@ -1256,7 +1256,7 @@ void World::SetInitialWorldSettings()
|
||||
//No SQL injection as values are treated as integers
|
||||
|
||||
// not send custom type REALM_FFA_PVP to realm list
|
||||
uint32 server_type = IsFFAPvPRealm() ? REALM_TYPE_PVP : getIntConfig(CONFIG_GAME_TYPE);
|
||||
uint32 server_type = IsFFAPvPRealm() ? uint32(REALM_TYPE_PVP) : getIntConfig(CONFIG_GAME_TYPE);
|
||||
uint32 realm_zone = getIntConfig(CONFIG_REALM_ZONE);
|
||||
|
||||
LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%d'", server_type, realm_zone, realmID); // One-time query
|
||||
|
||||
@@ -112,7 +112,7 @@ class boss_moam : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA))
|
||||
if (uint32(me->GetPower(POWER_MANA)) == me->GetMaxPower(POWER_MANA))
|
||||
{
|
||||
if (_isStonePhase)
|
||||
DoAction(ACTION_STONE_PHASE_END);
|
||||
|
||||
@@ -406,7 +406,7 @@ class boss_deathbringer_saurfang : public CreatureScript
|
||||
case 72444:
|
||||
case 72445:
|
||||
case 72446:
|
||||
if (me->GetPower(POWER_ENERGY) != me->GetMaxPower(POWER_ENERGY))
|
||||
if (uint32(me->GetPower(POWER_ENERGY)) != me->GetMaxPower(POWER_ENERGY))
|
||||
target->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, me, true);
|
||||
break;
|
||||
default:
|
||||
@@ -1039,7 +1039,7 @@ class spell_deathbringer_blood_link_aura : public SpellScriptLoader
|
||||
void HandlePeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (GetUnitOwner()->getPowerType() == POWER_ENERGY && GetUnitOwner()->GetPower(POWER_ENERGY) == GetUnitOwner()->GetMaxPower(POWER_ENERGY))
|
||||
if (GetUnitOwner()->getPowerType() == POWER_ENERGY && uint32(GetUnitOwner()->GetPower(POWER_ENERGY)) == GetUnitOwner()->GetMaxPower(POWER_ENERGY))
|
||||
if (Creature* saurfang = GetUnitOwner()->ToCreature())
|
||||
saurfang->AI()->DoAction(ACTION_MARK_OF_THE_FALLEN_CHAMPION);
|
||||
}
|
||||
@@ -1131,7 +1131,7 @@ class spell_deathbringer_rune_of_blood : public SpellScriptLoader
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex); // make this the default handler
|
||||
if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY))
|
||||
if (uint32(GetCaster()->GetPower(POWER_ENERGY)) != GetCaster()->GetMaxPower(POWER_ENERGY))
|
||||
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, GetCaster(), true);
|
||||
}
|
||||
|
||||
@@ -1166,7 +1166,7 @@ class spell_deathbringer_blood_nova : public SpellScriptLoader
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex); // make this the default handler
|
||||
if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY))
|
||||
if (uint32(GetCaster()->GetPower(POWER_ENERGY)) != GetCaster()->GetMaxPower(POWER_ENERGY))
|
||||
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, GetCaster(), true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user