Apply style fix pt2

This commit is contained in:
Antz 2020-01-12 00:21:01 +00:00
parent 35405dd549
commit 1392c131e7
77 changed files with 1318 additions and 817 deletions

View file

@ -828,7 +828,10 @@ bool AuctionBotBuyer::IsBuyableEntry(uint64 buyoutPrice, double InGame_BuyPrice,
{
Chance = MaxChance - (ratio * (MaxChance / 10));
}
else { Chance = 1; }
else
{
Chance = 1;
}
}
}
}
@ -847,7 +850,10 @@ bool AuctionBotBuyer::IsBuyableEntry(uint64 buyoutPrice, double InGame_BuyPrice,
{
Chance = (MaxChance / 5) - (ratio * (MaxChance / 50));
}
else { Chance = 1; }
else
{
Chance = 1;
}
}
}
}
@ -862,9 +868,15 @@ bool AuctionBotBuyer::IsBuyableEntry(uint64 buyoutPrice, double InGame_BuyPrice,
{
Chance = (MaxChance / 5) - (ratio * (MaxChance / 50));
}
else { Chance = 0; }
else
{
Chance = 0;
}
}
else
{
Chance = 0;
}
else { Chance = 0; }
}
uint32 RandNum = urand(1, ChanceRatio);
if (RandNum <= Chance)
@ -1056,8 +1068,14 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
if (IsBuyableEntry(buyoutPrice, InGame_BuyPrice, MaxBuyablePrice, minBuyPrice, MaxChance, config.FactionChance))
{
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, minBidPrice, MaxChance / 2, config.FactionChance))
if (urand(0, 5) == 0) { PlaceBidToEntry(auction, bidPrice); }
else { BuyEntry(auction); }
if (urand(0, 5) == 0)
{
PlaceBidToEntry(auction, bidPrice);
}
else
{
BuyEntry(auction);
}
else
{ BuyEntry(auction); }
}
@ -1093,7 +1111,10 @@ bool AuctionBotBuyer::Update(AuctionHouseType houseType)
}
return true;
}
else { return false; }
else
{
return false;
}
}
//== AuctionBotSeller functions ============================
@ -1898,7 +1919,10 @@ void AuctionBotSeller::addNewAuctions(AHB_Seller_Config& config)
items = sAuctionBotConfig.GetItemPerCycleBoost();
BASIC_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Boost value used to fill AH! (if this happens often adjust both ItemsPerCycle in ahbot.conf)");
}
else { items = sAuctionBotConfig.GetItemPerCycleNormal(); }
else
{
items = sAuctionBotConfig.GetItemPerCycleNormal();
}
uint32 houseid;
switch (config.GetHouseType())

View file

@ -607,7 +607,10 @@ void BattleGround::SendPacketToTeam(Team teamId, WorldPacket* packet, Player* se
}
Team team = itr->second.PlayerTeam;
if (!team) { team = plr->GetTeam(); }
if (!team)
{
team = plr->GetTeam();
}
if (team == teamId)
{
@ -651,7 +654,10 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, Team teamId)
}
Team team = itr->second.PlayerTeam;
if (!team) { team = plr->GetTeam(); }
if (!team)
{
team = plr->GetTeam();
}
if (team == teamId)
{
@ -684,7 +690,10 @@ void BattleGround::CastSpellOnTeam(uint32 SpellID, Team teamId)
}
Team team = itr->second.PlayerTeam;
if (!team) { team = plr->GetTeam(); }
if (!team)
{
team = plr->GetTeam();
}
if (team == teamId)
{
@ -716,7 +725,10 @@ void BattleGround::RewardHonorToTeam(uint32 Honor, Team teamId)
}
Team team = itr->second.PlayerTeam;
if (!team) { team = plr->GetTeam(); }
if (!team)
{
team = plr->GetTeam();
}
if (team == teamId)
{
@ -756,7 +768,10 @@ void BattleGround::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
}
Team team = itr->second.PlayerTeam;
if (!team) { team = plr->GetTeam(); }
if (!team)
{
team = plr->GetTeam();
}
if (team == teamId)
{
@ -1286,7 +1301,10 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
{
plr->ClearAfkReports();
if (!team) { team = plr->GetTeam(); }
if (!team)
{
team = plr->GetTeam();
}
// if arena, remove the specific arena auras
if (isArena())

View file

@ -1915,7 +1915,7 @@ uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsA
// add bg to update list
AddBattleGround(bg->GetInstanceID(), bg->GetTypeID(), bg);
#ifdef ENABLE_ELUNA
sEluna->OnBGCreate(bg, bgTypeId, bg->GetInstanceID());
#endif /* ENABLE_ELUNA */

View file

@ -179,8 +179,8 @@ bool ChatHandler::HandleGMCommand(char* args)
if (!*args)
{
if (m_session->GetPlayer()->isGameMaster())
{
m_session->SendNotification(LANG_GM_ON);
{
m_session->SendNotification(LANG_GM_ON);
}
else
{
@ -363,7 +363,10 @@ bool ChatHandler::HandleGPSCommand(char* args)
else
{ PSendSysMessage("You are INdoor"); }
}
else { PSendSysMessage("no VMAP available for area info"); }
else
{
PSendSysMessage("no VMAP available for area info");
}
PSendSysMessage(LANG_MAP_POSITION,
obj->GetMapId(), (mapEntry ? mapEntry->name[GetSessionDbcLocale()] : "<unknown>"),

View file

@ -5045,7 +5045,7 @@ bool ChatHandler::HandleLevelUpCommand(char* args)
return true;
}
}
return false;
}
}
@ -5464,7 +5464,10 @@ bool ChatHandler::HandleListAurasCommand(char* /*args*/)
for (int i = 0; i < TOTAL_AURAS; ++i)
{
Unit::AuraList const& uAuraList = unit->GetAurasByType(AuraType(i));
if (uAuraList.empty()) { continue; }
if (uAuraList.empty())
{
continue;
}
PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, uAuraList.size(), i);
for (Unit::AuraList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr)
{
@ -7226,7 +7229,10 @@ bool ChatHandler::HandleCastSelfCommand(char* args)
bool ChatHandler::HandleInstanceListBindsCommand(char* /*args*/)
{
Player* player = getSelectedPlayer();
if (!player) { player = m_session->GetPlayer(); }
if (!player)
{
player = m_session->GetPlayer();
}
uint32 counter = 0;
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
{

View file

@ -447,7 +447,10 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
{ return false; }
Player* player = getSelectedPlayer();
if (!player) { player = m_session->GetPlayer(); }
if (!player)
{
player = m_session->GetPlayer();
}
if (!list_queue && !check_all)
{
@ -461,7 +464,10 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
}
Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (!item) { continue; }
if (!item)
{
continue;
}
if (!item->IsBag())
{
if (item->GetState() == state)
@ -489,7 +495,10 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
for (size_t i = 0; i < updateQueue.size(); ++i)
{
Item* item = updateQueue[i];
if (!item) { continue; }
if (!item)
{
continue;
}
Bag* container = item->GetContainer();
uint8 bag_slot = container ? container->GetSlot() : uint8(INVENTORY_SLOT_BAG_0);
@ -524,7 +533,10 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
}
Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (!item) { continue; }
if (!item)
{
continue;
}
if (item->GetSlot() != i)
{
@ -587,7 +599,10 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
for (uint8 j = 0; j < bag->GetBagSize(); ++j)
{
Item* item2 = bag->GetItemByPos(j);
if (!item2) { continue; }
if (!item2)
{
continue;
}
if (item2->GetSlot() != j)
{
@ -658,7 +673,10 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
for (size_t i = 0; i < updateQueue.size(); ++i)
{
Item* item = updateQueue[i];
if (!item) { continue; }
if (!item)
{
continue;
}
if (item->GetOwnerGuid() != player->GetObjectGuid())
{
@ -675,7 +693,10 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
error = true; continue;
}
if (item->GetState() == ITEM_REMOVED) { continue; }
if (item->GetState() == ITEM_REMOVED)
{
continue;
}
Item* test = player->GetItemByPos(item->GetBagSlot(), item->GetSlot());
if (test == NULL)

View file

@ -2173,7 +2173,10 @@ SpellEntry const* Creature::ReachWithSpellAttack(Unit* pVictim)
break;
}
}
if (bcontinue) { continue; }
if (bcontinue)
{
continue;
}
if(spellInfo->GetManaCost() > GetPower(POWER_MANA))
{

View file

@ -379,7 +379,10 @@ struct VendorItemData
VendorItem* GetItem(uint32 slot) const
{
if (slot >= m_items.size()) { return NULL; }
if (slot >= m_items.size())
{
return NULL;
}
return m_items[slot];
}
bool Empty() const { return m_items.empty(); }
@ -714,7 +717,7 @@ class Creature : public Unit
/**
* function indicating whether the recipient is a group.
*
*
* \return boolean true if the creature's recipient is a group, false otherwise.
*/
bool IsGroupLootRecipient() const { return m_lootGroupRecipientId; }

View file

@ -131,7 +131,7 @@ CanCastResult CreatureAI::DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32
CanCastResult castResult = CanCastSpell(pTarget, pSpell, uiCastFlags & CAST_TRIGGERED);
if (castResult != CAST_OK)
{
{
return castResult;
}
}
@ -142,7 +142,7 @@ CanCastResult CreatureAI::DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32
pCaster->InterruptNonMeleeSpells(false);
}
// Creature should always stop before it will cast a non-instant spell
// Creature should always stop before it will cast a non-instant spell
if (GetSpellCastTime(pSpell))
pCaster->StopMoving();

View file

@ -74,17 +74,50 @@ namespace MaNGOS
inline uint32 GetZeroDifference(uint32 pl_level)
{
if (pl_level < 8) { return 5; }
if (pl_level < 10) { return 6; }
if (pl_level < 12) { return 7; }
if (pl_level < 16) { return 8; }
if (pl_level < 20) { return 9; }
if (pl_level < 30) { return 11; }
if (pl_level < 40) { return 12; }
if (pl_level < 45) { return 13; }
if (pl_level < 50) { return 14; }
if (pl_level < 55) { return 15; }
if (pl_level < 60) { return 16; }
if (pl_level < 8)
{
return 5;
}
if (pl_level < 10)
{
return 6;
}
if (pl_level < 12)
{
return 7;
}
if (pl_level < 16)
{
return 8;
}
if (pl_level < 20)
{
return 9;
}
if (pl_level < 30)
{
return 11;
}
if (pl_level < 40)
{
return 12;
}
if (pl_level < 45)
{
return 13;
}
if (pl_level < 50)
{
return 14;
}
if (pl_level < 55)
{
return 15;
}
if (pl_level < 60)
{
return 16;
}
return 17;
}

View file

@ -43,7 +43,7 @@ void GMTicketMgr::LoadGMTickets()
"SELECT guid, ticket_text, response_text, UNIX_TIMESTAMP(ticket_lastchange), ticket_id "
"FROM character_ticket "
"ORDER BY ticket_id ASC");
if (!result)
{
BarGoLink bar(1);

View file

@ -97,7 +97,7 @@ class GMTicket
m_lastUpdate = update;
}
/**
/**
* Gets the \ref Player s \ref ObjectGuid which asked the question and created the ticket
* @return the \ref ObjectGuid for the \ref Player that asked the question
*/
@ -121,7 +121,7 @@ class GMTicket
return m_lastUpdate;
}
/**
/**
* Changes the tickets question text.
* @param text the text to change the question to
*/
@ -214,7 +214,7 @@ class GMTicketMgr
return *itr;
}
/**
/**
* This will delete a \ref GMTicket from this manager of tickets so that we don't
* need to handle it anymore, this should be used in conjunction with setting
* resolved = 1 in the character_ticket table.
@ -236,7 +236,7 @@ class GMTicketMgr
void DeleteAll();
/**
/**
* This will create a new \ref GMTicket and fill it with the given question so that
* a GM can find it and answer it. Should only be called if we've already checked
* that there are no open tickets already, as this function will close any other

View file

@ -815,7 +815,10 @@ bool GameObject::IsTransport() const
{
// If something is marked as a transport, don't transmit an out of range packet for it.
GameObjectInfo const* gInfo = GetGOInfo();
if (!gInfo) { return false; }
if (!gInfo)
{
return false;
}
return gInfo->type == GAMEOBJECT_TYPE_TRANSPORT || gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT;
}

View file

@ -474,7 +474,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
#ifdef ENABLE_ELUNA
sEluna->OnExpire(owner, GetProto());
#endif /* ENABLE_ELUNA */
if (uint32 newItemId = sObjectMgr.GetItemExpireConvert(GetEntry()))
owner->ConvertItem(this, newItemId);
else
@ -941,7 +941,10 @@ void Item::SetState(ItemUpdateState state, Player* forplayer)
if (state != ITEM_UNCHANGED)
{
// new items must stay in new state until saved
if (uState != ITEM_NEW) { uState = state; }
if (uState != ITEM_NEW)
{
uState = state;
}
if (forplayer || GetOwnerGuid())
{

View file

@ -104,7 +104,10 @@ void LoadRandomEnchantmentsTable()
uint32 GetItemEnchantMod(int32 entry)
{
if (!entry) { return 0; }
if (!entry)
{
return 0;
}
EnchantmentStore::const_iterator tab;
if (entry > 0)
@ -134,7 +137,10 @@ uint32 GetItemEnchantMod(int32 entry)
{
fCount += ench_iter->chance;
if (fCount > dRoll) { return ench_iter->ench; }
if (fCount > dRoll)
{
return ench_iter->ench;
}
}
// we could get here only if sum of all enchantment chances is lower than 100%
@ -145,7 +151,10 @@ uint32 GetItemEnchantMod(int32 entry)
{
fCount += ench_iter->chance;
if (fCount > dRoll) { return ench_iter->ench; }
if (fCount > dRoll)
{
return ench_iter->ench;
}
}
return 0;

View file

@ -670,7 +670,10 @@ QuestItemList* Loot::FillFFALoot(Player* player)
QuestItemList* Loot::FillQuestLoot(Player* player)
{
if (items.size() == MAX_NR_LOOT_ITEMS) { return NULL; }
if (items.size() == MAX_NR_LOOT_ITEMS)
{
return NULL;
}
QuestItemList* ql = new QuestItemList();
for (uint8 i = 0; i < m_questItems.size(); ++i)

View file

@ -782,7 +782,10 @@ void Object::ClearUpdateMask(bool remove)
bool Object::LoadValues(const char* data)
{
if (!m_uint32Values) { _InitValues(); }
if (!m_uint32Values)
{
_InitValues();
}
Tokens tokens = StrSplit(data, " ");
@ -1318,7 +1321,10 @@ bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool
bool WorldObject::IsWithinLOSInMap(const WorldObject* obj) const
{
if (!IsInMap(obj)) { return false; }
if (!IsInMap(obj))
{
return false;
}
float ox, oy, oz;
obj->GetPosition(ox, oy, oz);
return(IsWithinLOS(ox, oy, oz));

View file

@ -3909,8 +3909,8 @@ void ObjectMgr::LoadQuests()
// 29 30 31 32
"RewXPId, SrcItemId, SrcItemCount, SrcSpell,"
// 33 34 35 36 37 38 39 40 41 42 43
"Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, PortraitGiverName, PortraitGiverText, PortraitTurnInName, PortraitTurnInText,"
// 44 45 46 47
"Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, PortraitGiverName, PortraitGiverText, PortraitTurnInName, PortraitTurnInText,"
// 44 45 46 47
"ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4,"
// 48 49 50 51 52 53 54 55 56 57 58 59
"ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6,"
@ -3929,12 +3929,12 @@ void ObjectMgr::LoadQuests()
// 95 96 97 98 99 100
"RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6,"
// 101 102 103 104 105 106 107 108
"RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4,"
"RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4,"
// 109 110 111 112
"RewCurrencyId1, RewCurrencyId2, RewCurrencyId3, RewCurrencyId4,"
// 113 114 115 116
"RewCurrencyCount1, RewCurrencyCount2, RewCurrencyCount3, RewCurrencyCount4,"
// 117 118
"RewCurrencyCount1, RewCurrencyCount2, RewCurrencyCount3, RewCurrencyCount4,"
// 117 118
"RewSkill, RewSkillValue,"
// 119 120 121 122 123
"RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5,"
@ -11050,4 +11050,4 @@ void ObjectMgr::LoadHotfixData()
sLog.outString();
sLog.outString(">> Loaded %u hotfix info entries.", count);
}
}

View file

@ -617,10 +617,19 @@ class ObjectMgr
PlayerInfo const* GetPlayerInfo(uint32 race, uint32 class_) const
{
if (race >= MAX_RACES) { return NULL; }
if (class_ >= MAX_CLASSES) { return NULL; }
if (race >= MAX_RACES)
{
return NULL;
}
if (class_ >= MAX_CLASSES)
{
return NULL;
}
PlayerInfo const* info = &playerInfo[race][class_];
if (info->displayId_m == 0 || info->displayId_f == 0) { return NULL; }
if (info->displayId_m == 0 || info->displayId_f == 0)
{
return NULL;
}
return info;
}
void GetPlayerLevelInfo(uint32 race, uint32 class_, uint32 level, PlayerLevelInfo* info) const;
@ -963,7 +972,10 @@ class ObjectMgr
CreatureDataPair const* GetCreatureDataPair(uint32 guid) const
{
CreatureDataMap::const_iterator itr = mCreatureDataMap.find(guid);
if (itr == mCreatureDataMap.end()) { return NULL; }
if (itr == mCreatureDataMap.end())
{
return NULL;
}
return &*itr;
}
@ -992,7 +1004,10 @@ class ObjectMgr
CreatureLocale const* GetCreatureLocale(uint32 entry) const
{
CreatureLocaleMap::const_iterator itr = mCreatureLocaleMap.find(entry);
if (itr == mCreatureLocaleMap.end()) { return NULL; }
if (itr == mCreatureLocaleMap.end())
{
return NULL;
}
return &itr->second;
}
@ -1001,14 +1016,20 @@ class ObjectMgr
GameObjectLocale const* GetGameObjectLocale(uint32 entry) const
{
GameObjectLocaleMap::const_iterator itr = mGameObjectLocaleMap.find(entry);
if (itr == mGameObjectLocaleMap.end()) { return NULL; }
if (itr == mGameObjectLocaleMap.end())
{
return NULL;
}
return &itr->second;
}
ItemLocale const* GetItemLocale(uint32 entry) const
{
ItemLocaleMap::const_iterator itr = mItemLocaleMap.find(entry);
if (itr == mItemLocaleMap.end()) { return NULL; }
if (itr == mItemLocaleMap.end())
{
return NULL;
}
return &itr->second;
}
@ -1017,7 +1038,10 @@ class ObjectMgr
QuestLocale const* GetQuestLocale(uint32 entry) const
{
QuestLocaleMap::const_iterator itr = mQuestLocaleMap.find(entry);
if (itr == mQuestLocaleMap.end()) { return NULL; }
if (itr == mQuestLocaleMap.end())
{
return NULL;
}
return &itr->second;
}
@ -1026,7 +1050,10 @@ class ObjectMgr
NpcTextLocale const* GetNpcTextLocale(uint32 entry) const
{
NpcTextLocaleMap::const_iterator itr = mNpcTextLocaleMap.find(entry);
if (itr == mNpcTextLocaleMap.end()) { return NULL; }
if (itr == mNpcTextLocaleMap.end())
{
return NULL;
}
return &itr->second;
}
@ -1037,28 +1064,40 @@ class ObjectMgr
PageTextLocale const* GetPageTextLocale(uint32 entry) const
{
PageTextLocaleMap::const_iterator itr = mPageTextLocaleMap.find(entry);
if (itr == mPageTextLocaleMap.end()) { return NULL; }
if (itr == mPageTextLocaleMap.end())
{
return NULL;
}
return &itr->second;
}
GossipMenuItemsLocale const* GetGossipMenuItemsLocale(uint32 entry) const
{
GossipMenuItemsLocaleMap::const_iterator itr = mGossipMenuItemsLocaleMap.find(entry);
if (itr == mGossipMenuItemsLocaleMap.end()) { return NULL; }
if (itr == mGossipMenuItemsLocaleMap.end())
{
return NULL;
}
return &itr->second;
}
PointOfInterestLocale const* GetPointOfInterestLocale(uint32 poi_id) const
{
PointOfInterestLocaleMap::const_iterator itr = mPointOfInterestLocaleMap.find(poi_id);
if (itr == mPointOfInterestLocaleMap.end()) { return NULL; }
if (itr == mPointOfInterestLocaleMap.end())
{
return NULL;
}
return &itr->second;
}
GameObjectDataPair const* GetGODataPair(uint32 guid) const
{
GameObjectDataMap::const_iterator itr = mGameObjectDataMap.find(guid);
if (itr == mGameObjectDataMap.end()) { return NULL; }
if (itr == mGameObjectDataMap.end())
{
return NULL;
}
return &*itr;
}
@ -1087,7 +1126,10 @@ class ObjectMgr
MangosStringLocale const* GetMangosStringLocale(int32 entry) const
{
MangosStringLocaleMap::const_iterator itr = mMangosStringLocaleMap.find(entry);
if (itr == mMangosStringLocaleMap.end()) { return NULL; }
if (itr == mMangosStringLocaleMap.end())
{
return NULL;
}
return &itr->second;
}
uint32 GetLoadedStringsCount(int32 minEntry) const
@ -1142,7 +1184,10 @@ class ObjectMgr
GameTele const* GetGameTele(uint32 id) const
{
GameTeleMap::const_iterator itr = m_GameTeleMap.find(id);
if (itr == m_GameTeleMap.end()) { return NULL; }
if (itr == m_GameTeleMap.end())
{
return NULL;
}
return &itr->second;
}

View file

@ -903,7 +903,7 @@ void Pet::InitStatsForLevel(uint32 petlevel)
case HUNTER_PET:
{
CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cInfo->Family);
if (cFamily && cFamily->minScale > 0.0f)
{
float scale;
@ -1028,7 +1028,7 @@ void Pet::InitStatsForLevel(uint32 petlevel)
float dMinLevel = cInfo->MinMeleeDmg / cInfo->MinLevel;
float dMaxLevel = cInfo->MaxMeleeDmg / cInfo->MaxLevel;
float mDmg = (dMaxLevel - ((dMaxLevel - dMinLevel) / 2)) * petlevel;
// Set damage
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(mDmg - mDmg / 4));
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((mDmg - mDmg / 4) * 1.5));
@ -1044,7 +1044,7 @@ void Pet::InitStatsForLevel(uint32 petlevel)
health = 1;
mana = 1;
armor = 1;
// Set damage
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 1);
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 1);

View file

@ -151,7 +151,7 @@ class Pet : public Creature
void setPetType(PetType type) { m_petType = type; }
bool isControlled() const { return getPetType() == SUMMON_PET || getPetType() == HUNTER_PET; }
bool isTemporarySummoned() const { return m_duration > 0; }
bool Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const* cinfo, uint32 pet_number);
bool CreateBaseAtCreature(Creature* creature);
bool LoadPetFromDB(Player* owner, uint32 petentry = 0, uint32 petnumber = 0, bool current = false);

View file

@ -368,7 +368,7 @@ void PetAI::UpdateAI(const uint32 diff)
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "PetAI (guid = %u) is stopping attack.", m_creature->GetGUIDLow());
m_creature->CombatStop();
inCombat = false;
return;
}

View file

@ -1218,7 +1218,7 @@ DrunkenState Player::GetDrunkenstateByValue(uint8 value)
return DRUNKEN_SMASHED;
if (value >= 50)
return DRUNKEN_DRUNK;
if (value)
if (value)
return DRUNKEN_TIPSY;
return DRUNKEN_SOBER;
}
@ -1235,7 +1235,7 @@ void Player::SetDrunkValue(uint8 newDrunkValue, uint32 itemId /*= 0*/)
SetByteValue(PLAYER_BYTES_3, 1, newDrunkValue);
uint32 newDrunkenState = Player::GetDrunkenstateByValue(newDrunkValue);
uint32 newDrunkenState = Player::GetDrunkenstateByValue(newDrunkValue);
// special drunk invisibility detection
if (newDrunkenState >= DRUNKEN_DRUNK)
@ -7045,7 +7045,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
#ifdef ENABLE_ELUNA
sEluna->OnUpdateZone(this, newZone, newArea);
#endif
m_zoneUpdateId = newZone;
m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
@ -15619,7 +15619,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder)
SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32());
SetByteValue(PLAYER_BYTES_3, 0, gender);
SetByteValue(PLAYER_BYTES_3, 1, fields[45].GetUInt8());
SetByteValue(PLAYER_BYTES_3, 1, fields[45].GetUInt8());
SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32());
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[44].GetInt32());
@ -15855,7 +15855,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder)
if (time_diff < uint32(GetDrunkValue()) * 9)
newDrunkValue = GetDrunkValue() - time_diff / 9;
SetDrunkValue(newDrunkValue);
SetDrunkValue(newDrunkValue);
m_cinematic = fields[18].GetUInt32();
m_Played_time[PLAYED_TIME_TOTAL] = fields[19].GetUInt32();
@ -20503,7 +20503,7 @@ void Player::SendInitialPacketsBeforeAddToMap()
data << uint32(sWorld.GetNextWeeklyQuestsResetTime() - WEEK); // LastWeeklyReset (not instance reset)
data << uint32(GetMap()->GetDifficulty());
GetSession()->SendPacket(&data);
GetSession()->SendPacket(&data);
SendInitialSpells();
@ -22956,7 +22956,7 @@ void Player::UnsummonPetIfAny()
Pet* pet = GetPet();
if (!pet)
return;
pet->Unsummon(PET_SAVE_NOT_IN_SLOT, this);
}

View file

@ -1173,8 +1173,14 @@ class Player : public Unit
void SetGMVisible(bool on);
void SetPvPDeath(bool on)
{
if (on) { m_ExtraFlags |= PLAYER_EXTRA_PVP_DEATH; }
else { m_ExtraFlags &= ~PLAYER_EXTRA_PVP_DEATH; }
if (on)
{
m_ExtraFlags |= PLAYER_EXTRA_PVP_DEATH;
}
else
{
m_ExtraFlags &= ~PLAYER_EXTRA_PVP_DEATH;
}
}
// 0 = own auction, -1 = enemy auction, 1 = goblin auction
@ -1223,7 +1229,7 @@ class Player : public Unit
return m_rest_bonus;
}
void SetRestBonus(float rest_bonus_new);
/**
* \brief: compute rest bonus
* \param: time_t timePassed > time from last check
@ -1589,7 +1595,7 @@ class Player : public Unit
void AddTimedQuest(uint32 quest_id) { m_timedquests.insert(quest_id); }
void RemoveTimedQuest(uint32 quest_id) { m_timedquests.erase(quest_id); }
/// Return collision height sent to client
float GetCollisionHeight(bool mounted) const;
@ -2574,7 +2580,7 @@ class Player : public Unit
GridReference<Player>& GetGridRef() { return m_gridRef; }
MapReference& GetMapRef() { return m_mapRef; }
bool IsTappedByMeOrMyGroup(Creature* creature);
bool isAllowedToLoot(Creature* creature);

View file

@ -1402,7 +1402,7 @@ struct DoSpellProcEvent
else
++count;
}
bool HasEntry(uint32 spellId) { return spe_map.find(spellId) != spe_map.end(); }
bool SetStateToEntry(uint32 spellId) { return (state = spe_map.find(spellId)) != spe_map.end(); }
SpellProcEventMap& spe_map;

View file

@ -752,7 +752,7 @@ enum ProcFlagsEx
/// If set trigger always but only one time (not used)
PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000,
/// For periodic heal
PROC_EX_PERIODIC_POSITIVE = 0x0040000,
PROC_EX_PERIODIC_POSITIVE = 0x0040000,
PROC_EX_CAST_END = 0x0080000 // procs on end of cast
};
@ -1127,7 +1127,7 @@ class SpellMgr
return 0;
}
bool IsHighRankOfSpell(uint32 spell1, uint32 spell2) const
{
SpellChainMap::const_iterator itr = mSpellChains.find(spell1);

View file

@ -213,7 +213,7 @@ void TemporarySummon::Update(uint32 update_diff, uint32 diff)
default:
break;
}
Creature::Update(update_diff, diff);
}

View file

@ -100,7 +100,7 @@ void MovementInfo::Read(ByteBuffer& data, uint16 opcode)
MovementStatusElements element = sequence[i];
if (element == MSEEnd)
break;
if (element >= MSEGuidBit0 && element <= MSEGuidBit7)
{
guid[element - MSEGuidBit0] = data.ReadBit();
@ -2197,7 +2197,10 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, CalcDamageInfo* damageInfo, Weapo
void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
{
if (damageInfo == 0) { return; }
if (damageInfo == 0)
{
return;
}
Unit* pVictim = damageInfo->target;
if (!this || !pVictim)
@ -9851,7 +9854,7 @@ bool Unit::SelectHostileTarget()
m_ThreatManager.modifyThreatPercent(target, -101);
// remove target from current attacker, do not exit combat settings
AttackStop(true);
AttackStop(true);
}
return false;
@ -12562,7 +12565,7 @@ Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry co
// initialize AI
pCreature->AIM_Initialize();
if (player)
{
// Initialize pet bar

File diff suppressed because it is too large Load diff

View file

@ -40,7 +40,10 @@ class MapReference : public Reference<Map, Player>
void targetObjectDestroyLink() override
{
// called from unlink()
if (isValid()) { getTarget()->m_mapRefManager.decSize(); }
if (isValid())
{
getTarget()->m_mapRefManager.decSize();
}
}
void sourceObjectDestroyLink() override
{

View file

@ -137,7 +137,7 @@ void LoadDB2Stores(const std::string& dataPath)
sLog.outError("Please extract correct db2 files from build %s", AcceptableClientBuildsListStr().c_str());
exit(1);
}
sLog.outString();
sLog.outString( ">> Initialized %d db2 stores", DB2FileCount );
}

View file

@ -297,7 +297,7 @@ int ReadDBCLocale(const std::string sDataPath)
{
std::string sDBCpath = sDataPath + "dbc/";
std::string sFilename;
for (int uLocaleIndex = 0; uLocaleIndex < MAX_LOCALE; ++uLocaleIndex)
{
sFilename = sDBCpath + "component.wow-" + fullLocaleNameList[uLocaleIndex].name + ".txt";
@ -848,7 +848,7 @@ void LoadDBCStores(const std::string& dataPath)
}
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTotemCategoryStore, dbcPath, "TotemCategory.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTransportAnimationStore, dbcPath,"TransportAnimation.dbc");
for (uint32 i = 0; i < sTransportAnimationStore.GetNumRows(); ++i)
if (TransportAnimationEntry const* entry = sTransportAnimationStore.LookupEntry(i))

View file

@ -35,7 +35,7 @@ bool IsAcceptableClientBuild(uint32 build);
std::string AcceptableClientBuildsListStr();
/**
* This function checks to see if there is a valid locale file (component.wow-<locale>.txt)
* This function checks to see if there is a valid locale file (component.wow-<locale>.txt)
* and returns an index to the locale or -1 if not found
* @PARAM dataPath full path to the data directory
* @RETURN index number representing the location of the locale in the its structure,

View file

@ -127,7 +127,7 @@ const char SpellCastingRequirementsEntryfmt[]="dixxixi";
const char SpellCategoriesEntryfmt[]="diiiiii";
const char SpellClassOptionsEntryfmt[]="dxiiiix";
const char SpellCooldownsEntryfmt[]="diii";
// 1 10 20 30
// 1 10 20 30
const char SpellEffectEntryfmt[]="difiiiffiiiiiifiifiiiiiiiix";
const char SpellEquippedItemsEntryfmt[]="diii";
const char SpellInterruptsEntryfmt[]="dixixi";

View file

@ -429,7 +429,7 @@ void InitializeOpcodes()
OPCODE(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode );
OPCODE(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
OPCODE(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode );
OPCODE(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard );
OPCODE(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard );
OPCODE(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode );
OPCODE(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode );
OPCODE(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode );

View file

@ -1324,7 +1324,7 @@ enum Opcodes
SMSG_BATTLEFIELD_MANAGER_ENTERING = 0x14E1,
SMSG_BATTLEFIELD_MANAGER_QUEUE_INVITE = 0x14E2,
CMSG_BATTLEFIELD_MANAGER_QUEUE_INVITE_RESPONSE = 0x14E3,
CMSG_BATTLEFIELD_MANAGER_QUEUE_REQUEST = 0x710C, // 4.3.4 15595
CMSG_BATTLEFIELD_MANAGER_QUEUE_REQUEST = 0x710C, // 4.3.4 15595
SMSG_BATTLEFIELD_MANAGER_QUEUE_REQUEST_RESPONSE = 0x14E5,
SMSG_BATTLEFIELD_MANAGER_EJECT_PENDING = 0x14E6,
SMSG_BATTLEFIELD_MANAGER_EJECTED = 0x14E7,

View file

@ -390,7 +390,7 @@ bool WorldSession::Update(PacketFilter& updater)
{
LogoutPlayer(true);
}
// WARDEN ISSUE - commented out to stop crash
// WARDEN ISSUE - commented out to stop crash
// if (m_Socket && GetPlayer() && _warden)
// _warden->Update();

View file

@ -541,7 +541,7 @@ class WorldSession
void HandleLogoutRequestOpcode(WorldPacket& recvPacket);
void HandlePlayerLogoutOpcode(WorldPacket& recvPacket);
void HandleLogoutCancelOpcode(WorldPacket& recvPacket);
void HandleGMTicketGetTicketOpcode(WorldPacket& recvPacket);
void HandleGMTicketCreateOpcode(WorldPacket& recvPacket);
void HandleGMTicketSystemStatusOpcode(WorldPacket& recvPacket);
@ -962,7 +962,7 @@ class WorldSession
// Hotfix handlers
void HandleRequestHotfix(WorldPacket& recv_data);
void SendItemDb2Reply(uint32 entry);
void SendItemSparseDb2Reply(uint32 entry);
void SendItemSparseDb2Reply(uint32 entry);
void HandleObjectUpdateFailedOpcode(WorldPacket& recv_data);

View file

@ -485,7 +485,10 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
guid = sObjectMgr.m_CharGuids.GetNextAfterMaxUsed();
delete result;
}
else { incHighest = false; }
else
{
incHighest = false;
}
}
else
{ guid = sObjectMgr.m_CharGuids.GetNextAfterMaxUsed(); }
@ -528,7 +531,10 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
{
if (!fgets(buf, 32000, fin))
{
if (feof(fin)) { break; }
if (feof(fin))
{
break;
}
ROLLBACK(DUMP_FILE_BROKEN);
}

View file

@ -235,7 +235,7 @@ ChatCommand* ChatHandler::getCommandTable()
{ "equiperror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendEquipErrorCommand, "", NULL },
{ "largepacket", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendLargePacketCommand, "", NULL },
{ "opcode", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendOpcodeCommand, "", NULL },
{ "phase", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugPhaseCommand, "", NULL },
{ "phase", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugPhaseCommand, "", NULL },
{ "poi", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendPoiCommand, "", NULL },
{ "qpartymsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendQuestPartyMsgCommand, "", NULL },
{ "qinvalidmsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendQuestInvalidMsgCommand, "", NULL },
@ -1471,8 +1471,8 @@ bool ChatHandler::isValidChatMessage(const char* message)
/*
valid examples:
|cff00aa00|Hcurrency:391|h[Ðåêîìåíäàòåëüíûé çíà÷îê Òîë Áàðàäà]|h|r
|cffff8000|Hinstancelock:070000000177AF81:532:0:1|h[Êàðàæàí]|h|r NYI
|cff00aa00|Hcurrency:391|h[<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]|h|r
|cffff8000|Hinstancelock:070000000177AF81:532:0:1|h[<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]|h|r NYI
|cffa335ee|Hitem:812:0:0:0:0:0:0:0:70|h[Glowing Brightwood Staff]|h|r
|cff808080|Hquest:2278:47|h[The Platinum Discs]|h|r
|cffffd000|Htrade:4037:1:150:1:6AAAAAAAAAAAAAAAAAAAAAAOAADAAAAAAAAAAAAAAAAIAAAAAAAAA|h[Engineering]|h|r

View file

@ -570,7 +570,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data)
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, chn))
return;
#endif /* ENABLE_ELUNA */
chn->Say(_player, msg.c_str(), lang);
chn->Say(_player, msg.c_str(), lang);
}
}

View file

@ -457,7 +457,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid
if (ql->PortraitTurnInText.size() > (size_t)loc_idx && !ql->PortraitTurnInText[loc_idx].empty())
PortraitTurnInText = ql->PortraitTurnInText[loc_idx];
}
}
}
WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, 100); // guess size
data << guid;
@ -519,7 +519,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid
data << pQuest->GetBonusTalents(); // bonus talents
data << uint32(0); // unk, unused bonus arena points?
data << uint32(0); // rep reward show mask?
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids
data << pQuest->RewRepFaction[i];
@ -553,7 +553,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid
GetMenuSession()->SendPacket(&data);
DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS - for %s of %s, questid = %u", GetMenuSession()->GetPlayer()->GetGuidStr().c_str(), guid.GetString().c_str(), pQuest->GetQuestId());
}
}
// send only static data in this packet!
void PlayerMenu::SendQuestQueryResponse(Quest const* pQuest)
@ -652,8 +652,8 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* pQuest)
data << uint32(pQuest->GetRewSkill()); // Rewarded skill id
data << uint32(pQuest->GetRewSkillValue()); // Rewarded skill bonus points
data << uint32(0); // rew rep show mask?
data << uint32(pQuest->GetPortraitGiver());
data << uint32(pQuest->GetPortraitTurnIn());
data << uint32(pQuest->GetPortraitGiver());
data << uint32(pQuest->GetPortraitTurnIn());
int iI;

View file

@ -128,7 +128,7 @@ struct GridMapLiquidData
class GridMap
{
private:
uint16 m_holes[16][16];
uint32 m_flags;

View file

@ -243,7 +243,7 @@ namespace MaNGOS
/*
template<class Check>
struct WorldObjectLastSearcher
{
{
WorldObject*& i_object;
Check& i_check;

View file

@ -406,7 +406,7 @@ class Group
void _setLeader(ObjectGuid guid);
void _removeRolls(ObjectGuid guid);
void _updateLeaderFlag(const bool remove = false);
bool _setMembersGroup(ObjectGuid guid, uint8 group);

View file

@ -535,7 +535,7 @@ void WorldSession::HandleGuildSetRankOpcode(WorldPacket& recvPacket)
if (promote)
{
// allow to promote only to lower rank than member's rank
// and only to rank not higher that invoker's
// and only to rank not higher that invoker's
if (GetPlayer()->GetRank() + 1 >= slot->RankId || newRankId <= GetPlayer()->GetRank())
{
SendGuildCommandResult(GUILD_INVITE_S, plName, ERR_GUILD_RANK_TOO_HIGH_S);

File diff suppressed because it is too large Load diff

View file

@ -178,7 +178,7 @@ enum LFGRoleCheckState
LFG_ROLECHECK_NO_ROLE = 6 // Someone didn't select a role
};
/// Role types
/// Role types
enum LFGRoles
{
PLAYER_ROLE_NONE = 0x00,
@ -260,7 +260,7 @@ struct ItemRewards
{
uint32 itemId;
uint32 itemAmount;
ItemRewards() : itemId(0), itemAmount(0) {}
ItemRewards(uint32 ItemId, uint32 ItemAmount) : itemId(ItemId), itemAmount(ItemAmount) {}
};
@ -273,12 +273,12 @@ struct LFGPlayers //TODO: rename to LFGQueueData
roleMap currentRoles; // tank, dps, healer, etc..
std::string comments;
bool isGroup;
time_t joinedTime;
uint8 neededTanks;
uint8 neededHealers;
uint8 neededDps;
LFGPlayers() : currentState(LFG_STATE_NONE), currentRoles(0), isGroup(false) {}
LFGPlayers(LFGState state, std::set<uint32> dungeonSelection, roleMap CurrentRoles, std::string comment, bool IsGroup, time_t JoinedTime,
uint8 NeededTanks, uint8 NeededHealers, uint8 NeededDps) : currentState(state), dungeonList(dungeonSelection),
@ -290,7 +290,7 @@ struct LFGRoleCheck
{
LFGRoleCheckState state; // current status of the role check
roleMap currentRoles; // map of players to roles
std::set<uint32> dungeonList; // The dungeons this player or group are queued for
std::set<uint32> dungeonList; // The dungeons this player or group are queued for
uint32 randomDungeonID; // The random dungeon ID
uint64 leaderGuidRaw; // ObjectGuid(raw) of leader
time_t waitForRoleTime; // How long we'll wait for the players to confirm their roles
@ -302,7 +302,7 @@ struct LFGWait
int32 previousTime; // how long it took for the last person to go from queue to instance
uint32 playerCount; // amount of players in x queue for calculations [not sure if needed when finished implementing system]
bool doAverage; // tells the lfgmgr during a world update whether or not to recalculate waiting time
LFGWait() : time(-1), previousTime(-1), playerCount(0), doAverage(false) {}
LFGWait(int32 currentTime, int32 lastTime, uint32 currentPlayerCount, bool shouldRecalculate)
: time(currentTime), previousTime(lastTime), playerCount(currentPlayerCount), doAverage(shouldRecalculate) {}
@ -330,7 +330,7 @@ struct LFGPlayerStatus
LfgUpdateType updateType;
std::set<uint32> dungeonList;
std::string comment;
LFGPlayerStatus() { }
LFGPlayerStatus(LFGState State, LfgUpdateType UpdateType, std::set<uint32> DungeonList, std::string Comment)
: state(State), updateType(UpdateType), dungeonList(DungeonList), comment(Comment) { }
@ -343,7 +343,7 @@ struct LFGGroupStatus //todo: check for this in joinlfg function, not lfgplayers
uint32 dungeonID; // ID of the dungeon the group should be in
roleMap playerRoles; // Container holding each player's objectguid and their roles
ObjectGuid leaderGuid; // The group leader's object guid
LFGGroupStatus() { }
LFGGroupStatus(LFGState State, uint32 DungeonID, roleMap PlayerRoles, ObjectGuid LeaderGuid)
: state(State), dungeonID(DungeonID), playerRoles(PlayerRoles), leaderGuid(LeaderGuid) { }
@ -375,7 +375,7 @@ struct LFGRewards
uint32 expReward; // Amount of experience rewarded
uint32 itemID; // ID of item reward
uint32 itemAmount; // How many of x item is rewarded
LFGRewards() { }
LFGRewards(uint32 RandomDungeonEntry, uint32 GroupDungeonEntry, bool HasDoneDaily,
uint32 MoneyReward, uint32 ExpReward, uint32 ItemID, uint32 ItemAmount) :
@ -392,7 +392,7 @@ struct LFGBoot
std::string reason; // Reason stated for the vote
proposalAnswerMap answers; // Player's votes
time_t startTime; // When the vote started
LFGBoot() { }
LFGBoot(bool InProgress, ObjectGuid PlayerVotedOn, std::string Reason, proposalAnswerMap Answers, time_t StartTime)
: inProgress(InProgress), playerVotedOn(PlayerVotedOn), reason(Reason), answers(Answers), startTime(StartTime) { }
@ -405,291 +405,291 @@ class LFGMgr
public:
LFGMgr();
~LFGMgr();
/// Update queue information and such
void Update();
/**
* @brief Attempt to join the dungeon finder queue, as long as the player(s)
* fit the criteria.
*
*
* @param roles Roles selected in lfg window
* @param dungeons List of dungeon(s) selected
* @param comments Comments made by the player
* @param plr Pointer to the player sending the packet
*/
void JoinLFG(uint32 roles, std::set<uint32> dungeons, std::string comments, Player* plr);
/**
* @brief Leave the lfg/dungeon finder system.
*
*
* @param plr The pointer to the player sending the request
* @param isGroup Whether or not they are the leader of a group / in a group
*/
void LeaveLFG(Player* plr, bool isGroup);
/**
* @brief Go through a number of checks to see if the player/group can join
* the LFG queue
*
*
* @param plr The pointer to the player
*/
LfgJoinResult GetJoinResult(Player* plr);
/**
* @brief Fetch the playerstatus struct of a player on request, if existant
*
*
* @param guid the player's objectguid
*/
LFGPlayerStatus GetPlayerStatus(ObjectGuid guid);
/**
* @brief Set the player's comment string
*
*
* @param guid The player's objectguid
* @param comment Their comments
*/
void SetPlayerComment(ObjectGuid guid, std::string comment);
/**
* @brief Set the player's LFG state
*
*
* @param guid The player's objectguid
* @param state the LFGState value
*/
void SetPlayerState(ObjectGuid guid, LFGState state);
/**
* @brief Set the player's LFG update type
*
*
* @param guid The player's objectguid
* @param updateType The LfgUpdateType value
*/
void SetPlayerUpdateType(ObjectGuid guid, LfgUpdateType updateType);
/**
* @brief Used to fetch the item rewards of a dungeon from the database
*
*
* @param dungeonId the dungeon ID used in the DBCs
* @param type the type of dungeon
*/
ItemRewards GetDungeonItemRewards(uint32 dungeonId, DungeonTypes type);
/**
* @brief Used to determine the type of dungeon for ease of use.
*
*
* @param dungeonId the dungeon ID used in the DBCs
*/
DungeonTypes GetDungeonType(uint32 dungeonId);
/**
* @brief Used to record the first time a player has entered x type of dungeon in the day.
*
*
* @param guidLow the player's guidLow
* @param dungeon the specific type/expansion of dungeon
*/
void RegisterPlayerDaily(uint32 guidLow, DungeonTypes dungeon);
/**
* @brief Used to find whether or not the player has done x type of dungeon today.
*
*
* @param guidLow the player's guidLow
* @param dungeon the specific type/expansion of dungeon
*/
bool HasPlayerDoneDaily(uint32 guidLow, DungeonTypes dungeon);
/// Reset accounts of players completing a/any dungeon for the day for new rewards
void ResetDailyRecords();
/**
* @brief Find out whether or not a special dungeon is available for that season
*
* @brief Find out whether or not a special dungeon is available for that season
*
* @param dungeonId the ID of the dungeon in question
*/
bool IsSeasonActive(uint32 dungeonId);
/**
* @brief Find the random dungeons applicable for a player
*
* @brief Find the random dungeons applicable for a player
*
* @param level The level of said player
* @param expansion The player's expansion
*/
dungeonEntries FindRandomDungeonsForPlayer(uint32 level, uint8 expansion);
/**
* @brief Find the random dungeons not applicable for a player
*
*
* @param level The level of said player
* @param expansion The player's expansion
*/
dungeonForbidden FindRandomDungeonsNotForPlayer(Player* plr);
/// Given the ID of a dungeon, spit out its entry
uint32 GetDungeonEntry(uint32 ID);
/// Teleports a player out of a dungeon (called by CMSG_LFG_TELEPORT)
void TeleportPlayer(Player* pPlayer, bool out);
/// Queue Functions Below
/**
* Find the player's or group's information and update the system with
* the amount of each role they need to find.
*
*
* @param guid The guid assigned to the structure
* @param information The LFGPlayers structure containing their information
*/
void UpdateNeededRoles(ObjectGuid guid, LFGPlayers* information);
/**
* @brief Add the player or group to the Dungeon Finder queue
*
*
* @param guid the player/group's ObjectGuid
*/
void AddToQueue(ObjectGuid guid);
/**
* @brief Remove the player or group from the Dungeon Finder queue
*
*
* @param guid the player/group's ObjectGuid
*/
void RemoveFromQueue(ObjectGuid guid);
/// Search the queue for compatible matches
void FindQueueMatches();
/**
* @brief Search the queue for matches based off of one's guid
*
*
* @param guid The player or group's guid
*/
void FindSpecificQueueMatches(ObjectGuid guid);
/// Send a periodic status update for queued players
void SendQueueStatus();
/// Role-Related Functions
/**
* @brief Set and/or confirm roles for a group.
*
*
* @param pPlayer The pointer to the player issuing the request
* @param pGroup The pointer to that player's group
* @param roles The group leader's role(s)
*/
void PerformRoleCheck(Player* pPlayer, Group* pGroup, uint8 roles);
/// Make sure role selections are okay
bool ValidateGroupRoles(roleMap groupMap);
/// Proposal-Related Functions
void ProposalUpdate(uint32 proposalID, ObjectGuid plrGuid, bool accepted);
/// Handles reward hooks -- called by achievement manager
void HandleBossKilled(Player* pPlayer);
/// Group kick hook
void AttemptToKickPlayer(Group* pGroup, ObjectGuid guid, ObjectGuid kicker, std::string reason);
// Called when a player votes yes or no on a boot vote
void CastVote(Player* pPlayer, bool vote);
protected:
bool IsSeasonal(uint32 dbcFlags) { return ((dbcFlags & LFG_FLAG_SEASONAL) != 0) ? true : false; }
/// Check if player/party is already in the system, return that data
LFGPlayers* GetPlayerOrPartyData(ObjectGuid guid);
/// Get a proposal structure given its id
LFGProposal* GetProposalData(uint32 proposalID);
/// Get information on a group currently in a dungeon
LFGGroupStatus* GetGroupStatus(ObjectGuid guid);
/// Add the player to their respective waiting map for their dungeon
void AddToWaitMap(uint8 role, std::set<uint32> dungeons);
/// Checks if any players have the leader flag for their roles
bool HasLeaderFlag(roleMap const& roles);
/// Compares two groups/players to see if their role combinations are compatible
bool RoleMapsAreCompatible(LFGPlayers* groupOne, LFGPlayers* groupTwo);
/// Checks whether or not two combinations of players/groups are on the same team (alliance/horde)
bool MatchesAreOfSameTeam(LFGPlayers* groupOne, LFGPlayers* groupTwo);
/// Are the players in a proposal already grouped up?
bool IsProposalSameGroup(LFGProposal const& proposal);
/// Update a proposal after a player refused to join
void ProposalDeclined(ObjectGuid guid, LFGProposal* proposal);
/// Updates a wait map with the amount of time it took the last player to join
void UpdateWaitMap(LFGRoles role, uint32 dungeonID, time_t waitTime);
/// Creates a group so they can enter a dungeon together
void CreateDungeonGroup(LFGProposal* proposal);
/// Sends a group to the dungeon assigned to them
void TeleportToDungeon(uint32 dungeonID, Group* pGroup);
/**
* @brief Merges two players/groups/etc into one for dungeon assignment.
*
*
* @param guidOne The guid assigned to the first group in m_playerData
* @param guidTwo The guid assigned to the second group in m_playerData
* @param compatibleDungeons The dungeons that both players or groups agreed to doing
*/
void MergeGroups(ObjectGuid guidOne, ObjectGuid guidTwo, std::set<uint32> compatibleDungeons);
/// Send a proposal to each member of a group
void SendDungeonProposal(LFGPlayers* lfgGroup);
/// Tell a group member that someone else just confirmed their role
void SendRoleChosen(ObjectGuid plrGuid, ObjectGuid confirmedGuid, uint8 roles);
/// Send SMSG_LFG_ROLE_CHECK_UPDATE to a specific player
void SendRoleCheckUpdate(ObjectGuid plrGuid, LFGRoleCheck const& roleCheck);
/// Send SMSG_LFG_UPDATE_PARTY or SMSG_LFG_UPDATE_PLAYER
void SendLfgUpdate(ObjectGuid plrGuid, LFGPlayerStatus status, bool isGroup);
/// Send SMSG_LFG_JOIN_RESULT
void SendLfgJoinResult(ObjectGuid plrGuid, LfgJoinResult result, LFGState state, partyForbidden const& lockedDungeons);
/// Get rid of expired role checks
void RemoveOldRoleChecks();
private:
/// Daily occurences of a player doing X type dungeon
dailyEntries m_dailyAny;
dailyEntries m_dailyTBCHeroic;
dailyEntries m_dailyLKNormal;
dailyEntries m_dailyLKHeroic;
/// General info related to joining / leaving the dungeon finder
playerData m_playerData;
queueSet m_queueSet;
/// Dungeon Finder Status for players
playerStatusMap m_playerStatusMap;
groupSet m_groupSet;
groupStatusMap m_groupStatusMap;
/// Role check information
roleCheckMap m_roleCheckMap;
/// Boot vote information
bootStatusMap m_bootStatusMap;
/// Wait times for the queue
waitTimeMap m_tankWaitTime;
waitTimeMap m_healerWaitTime;
waitTimeMap m_dpsWaitTime;
waitTimeMap m_avgWaitTime;
/// Proposal information
uint32 m_proposalId;
proposalMap m_proposalMap;

View file

@ -114,8 +114,14 @@ class Map : public GridRefManager<NGridType>
// currently unused for normal maps
bool CanUnload(uint32 diff)
{
if (!m_unloadTimer) { return false; }
if (m_unloadTimer <= diff) { return true; }
if (!m_unloadTimer)
{
return false;
}
if (m_unloadTimer <= diff)
{
return true;
}
m_unloadTimer -= diff;
return false;
}
@ -492,4 +498,4 @@ Map::Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER>& visitor)
getNGrid(x, y)->Visit(cell_x, cell_y, visitor);
}
}
#endif
#endif

View file

@ -240,7 +240,7 @@ void WorldSession::HandlePetAction(WorldPacket& recv_data)
const SpellRangeEntry* sRange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex);
if (unit_target && !(pet->IsWithinDistInMap(unit_target, sRange->maxRange) && pet->IsWithinLOSInMap(unit_target))
if (unit_target && !(pet->IsWithinDistInMap(unit_target, sRange->maxRange) && pet->IsWithinLOSInMap(unit_target))
&& !(GetPlayer()->IsFriendlyTo(unit_target) || pet->HasAuraType(SPELL_AURA_MOD_POSSESS)))
{
((Pet*)pet)->SetSpellOpener(spellid, sRange->minRange, sRange->maxRange);
@ -805,4 +805,4 @@ void WorldSession::HandleDismissCritter(WorldPacket& recvData)
if (pet->GetTypeId() == TYPEID_UNIT && ((Creature*)pet)->IsTemporarySummon())
((TemporarySummon*)pet)->UnSummon();
}
}
}

View file

@ -52,7 +52,7 @@ Quest::Quest(Field* questRecord)
CharTitleId = questRecord[20].GetUInt32();
PlayersSlain = questRecord[21].GetUInt32();
BonusTalents = questRecord[22].GetUInt32();
PortraitGiver = questRecord[23].GetUInt32();
PortraitTurnIn = questRecord[24].GetUInt32();
@ -71,7 +71,7 @@ Quest::Quest(Field* questRecord)
RequestItemsText = questRecord[37].GetCppString();
EndText = questRecord[38].GetCppString();
CompletedText = questRecord[39].GetCppString();
PortraitGiverName = questRecord[40].GetCppString();
PortraitGiverText = questRecord[41].GetCppString();
PortraitTurnInName = questRecord[42].GetCppString();
@ -97,12 +97,12 @@ Quest::Quest(Field* questRecord)
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ReqCreatureOrGOCount[i] = questRecord[72 + i].GetUInt32();
for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i)
ReqCurrencyId[i] = questRecord[76 + i].GetUInt32();
for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i)
ReqCurrencyCount[i] = questRecord[80 + i].GetUInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ReqSpell[i] = questRecord[84 + i].GetUInt32();
@ -119,8 +119,8 @@ Quest::Quest(Field* questRecord)
RewItemId[i] = questRecord[101 + i].GetUInt32();
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
RewItemCount[i] = questRecord[105 + i].GetUInt32();
RewItemCount[i] = questRecord[105 + i].GetUInt32();
for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i)
RewCurrencyId[i] = questRecord[109 + i].GetUInt32();
for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i)
@ -164,7 +164,7 @@ Quest::Quest(Field* questRecord)
OfferRewardEmote[i] = questRecord[156 + i].GetInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmoteDelay[i] = questRecord[160 + i].GetInt32();
OfferRewardEmoteDelay[i] = questRecord[160 + i].GetInt32();
SoundAcceptId = questRecord[164].GetUInt32();
SoundTurnInId = questRecord[165].GetUInt32();

View file

@ -2713,7 +2713,7 @@ bool ScriptMgr::OnEffectDummy(Unit* pCaster, uint32 spellId, SpellEffectIndex ef
return false;
#endif
}
bool ScriptMgr::OnEffectDummy(Unit* pCaster, uint32 spellId, SpellEffectIndex effIndex, GameObject* pTarget, ObjectGuid originalCasterGuid)
{
// Used by Eluna
@ -2728,7 +2728,7 @@ bool ScriptMgr::OnEffectDummy(Unit* pCaster, uint32 spellId, SpellEffectIndex ef
return false;
#endif
}
bool ScriptMgr::OnEffectDummy(Unit* pCaster, uint32 spellId, SpellEffectIndex effIndex, Item* pTarget, ObjectGuid originalCasterGuid)
{
// Used by Eluna

View file

@ -709,7 +709,7 @@ class ScriptMgr
ScriptNameMap m_scriptNames;
DBScripts m_dbScripts;
#ifdef _DEBUG
// mutex allowing to reload the script binding table; TODO just do it AWAY from any map update, e.g. right after sessions update
// mutex allowing to reload the script binding table; TODO just do it AWAY from any map update, e.g. right after sessions update
ACE_RW_Thread_Mutex m_bindMutex;
#endif /* _DEBUG */
// atomic op counter for active scripts amount

View file

@ -247,7 +247,7 @@ void SpellCastTargets::read(ByteBuffer& data, Unit* caster)
// TARGET_FLAG_UNK2 is used for non-combat pets, maybe other?
if (m_targetMask & (TARGET_FLAG_UNIT | TARGET_FLAG_UNK2))
data >> m_unitTargetGUID.ReadAsPacked();
if (m_targetMask & (TARGET_FLAG_OBJECT | TARGET_FLAG_GAMEOBJECT_ITEM))
data >> m_GOTargetGUID.ReadAsPacked();
@ -1692,7 +1692,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
uint32 unMaxTargets = m_spellInfo->GetMaxAffectedTargets();
float radius;
GetSpellRangeAndRadius(spellEffect, radius, EffectChainTarget, unMaxTargets);
GetSpellRangeAndRadius(spellEffect, radius, EffectChainTarget, unMaxTargets);
std::list<GameObject*> tempTargetGOList;
@ -6387,7 +6387,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
if (spellEffect->EffectMiscValueB && !m_caster->GetMountCapability(spellEffect->EffectMiscValueB))
return SPELL_FAILED_NOT_HERE;
return SPELL_FAILED_NOT_HERE;
// Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells
if (m_caster->GetTypeId() == TYPEID_PLAYER && !sMapStore.LookupEntry(m_caster->GetMapId())->IsMountAllowed() && !m_IsTriggeredSpell && !m_spellInfo->GetAreaGroupId())

View file

@ -1236,7 +1236,7 @@ void Aura::TriggerSpell()
// // Haunted
// case 18347: break;
// // Ranshalla Waiting
// case 18953: break;
// case 18953: break;
case 19695: // Inferno
{
@ -3535,7 +3535,7 @@ void Aura::HandleAuraMounted(bool apply, bool Real)
if (apply)
{
// Running Wild
// Running Wild
if (GetId() == 87840)
target->Mount(target->getGender() == GENDER_MALE ? 29422 : 29423, GetId());
@ -4497,7 +4497,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
{
//remove any existing charm just in case
caster->Uncharm();
//pets should be removed when possesing a target if somehow check was bypassed
((Player*)caster)->UnsummonPetIfAny();
}
@ -6395,7 +6395,7 @@ void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real)
{
// Special case with temporary increase max/current health
// Cases where we need to manually calculate the amount for the spell (by percentage)
// recalculate to full amount at apply for proper remove
// recalculate to full amount at apply for proper remove
case 54443: // Demonic Empowerment (Voidwalker)
case 55233: // Vampiric Blood
case 61254: // Will of Sartharion (Obsidian Sanctum)
@ -6404,7 +6404,7 @@ void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real)
// no break here
// Cases where m_amount already has the correct value (spells cast with CastCustomSpell or absolute values)
case 12976: // Warrior Last Stand triggered spell
case 28726: // Nightmare Seed ( Nightmare Seed )
case 31616: // Nature's Guardian
@ -7121,8 +7121,14 @@ void Aura::HandleShapeshiftBoosts(bool apply)
const PlayerSpellMap& sp_list = ((Player*)target)->GetSpellMap();
for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
{
if (itr->second.state == PLAYERSPELL_REMOVED) { continue; }
if (itr->first == spellId1 || itr->first == spellId2) { continue; }
if (itr->second.state == PLAYERSPELL_REMOVED)
{
continue;
}
if (itr->first == spellId1 || itr->first == spellId2)
{
continue;
}
SpellEntry const* spellInfo = sSpellStore.LookupEntry(itr->first);
if (!spellInfo || !IsNeedCastSpellAtFormApply(spellInfo, form))
{
@ -7900,7 +7906,7 @@ void Aura::PeriodicTick()
{
spell->cancel();
}
if (Player* modOwner = pCaster->GetSpellModOwner())
{
modOwner->ApplySpellMod(GetId(), SPELLMOD_ALL_EFFECTS, new_damage);
@ -8125,7 +8131,7 @@ void Aura::PeriodicTick()
pdamage = target->GetMaxPower(POWER_MANA) * 5 / 100;
drain_amount = target->GetPower(POWER_MANA) > pdamage ? pdamage : target->GetPower(POWER_MANA);
target->ModifyPower(POWER_MANA, -drain_amount);
SpellPeriodicAuraLogInfo info(this, drain_amount, 0, 0, 0, 0.0f);
target->SendPeriodicAuraLog(&info);
}

View file

@ -439,7 +439,7 @@ class Aura
Modifier const* GetModifier() const { return &m_modifier; }
int32 GetMiscValue() const { return m_spellEffect ? m_spellEffect->EffectMiscValue : 0; }
int32 GetMiscBValue() const { return m_spellEffect ? m_spellEffect->EffectMiscValueB : 0; }
SpellEntry const* GetSpellProto() const { return GetHolder()->GetSpellProto(); }
SpellEffectEntry const* GetSpellEffect() const { return m_spellEffect; }
uint32 GetId() const{ return GetHolder()->GetSpellProto()->Id; }

View file

@ -309,7 +309,7 @@ void Spell::EffectInstaKill(SpellEffectEntry const* /*effect*/)
data << unitTarget->GetObjectGuid(); // Victim GUID
data << uint32(m_spellInfo->Id);
m_caster->SendMessageToSet(&data, true);
m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, m_spellInfo, false);
}
@ -5390,7 +5390,7 @@ void Spell::EffectSummonType(SpellEffectEntry const* effect)
Unit* responsibleCaster = m_originalCaster;
if (realCaster->GetTypeId() == TYPEID_GAMEOBJECT)
responsibleCaster = ((GameObject*)realCaster)->GetOwner();
responsibleCaster = ((GameObject*)realCaster)->GetOwner();
// Expected Level (Totem, Pet and Critter may not use this)
uint32 level = responsibleCaster ? responsibleCaster->getLevel() : m_caster->getLevel();
@ -5429,7 +5429,7 @@ void Spell::EffectSummonType(SpellEffectEntry const* effect)
{
realCaster->GetRandomPoint(summonPositions[0].x, summonPositions[0].y, summonPositions[0].z, radius, itr->x, itr->y, itr->z);
if (realCaster->GetMap()->GetHitPosition(summonPositions[0].x, summonPositions[0].y, summonPositions[0].z, itr->x, itr->y, itr->z, m_caster->GetPhaseMask(), -0.5f))
realCaster->UpdateAllowedPositionZ(itr->x, itr->y, itr->z);
realCaster->UpdateAllowedPositionZ(itr->x, itr->y, itr->z);
}
else // Get a point near the caster
{
@ -5548,7 +5548,7 @@ void Spell::EffectSummonType(SpellEffectEntry const* effect)
if (!summonResult)
return; // No further handling required
for (itr = summonPositions.begin(); itr != summonPositions.end(); ++itr)
{
MANGOS_ASSERT(itr->creature || itr != summonPositions.begin());
@ -10322,7 +10322,7 @@ void Spell::EffectActivateObject(SpellEffectEntry const* effect)
uint32 templars[] = {15209, 15211, 15212, 15307};
uint32 dukes[] = {15206, 15207, 15208, 15220};
uint32 royals[] = {15203, 15204, 15205, 15305};
switch (m_spellInfo->Id)
{
case 24734: npcEntry = templars[urand(0, 3)]; break;
@ -10533,7 +10533,7 @@ void Spell::EffectInebriate(SpellEffectEntry const* /*effect*/)
if (roll_chance_i(25))
player->CastSpell(player, 67468, false); // Drunken Vomit
}
player->SetDrunkValue(drunkValue, m_CastItem ? m_CastItem->GetEntry() : 0);
player->SetDrunkValue(drunkValue, m_CastItem ? m_CastItem->GetEntry() : 0);
}
void Spell::EffectFeedPet(SpellEffectEntry const* effect)
@ -11723,7 +11723,7 @@ void Spell::EffectBind(SpellEffectEntry const* effect)
{
player->GetPosition(loc);
if (!area_id)
area_id = player->GetAreaId();
area_id = player->GetAreaId();
}
player->SetHomebindToLocation(loc, area_id);

View file

@ -3034,13 +3034,25 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
{
float stat = 0.0f;
// strength
if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 60229; stat = GetStat(STAT_STRENGTH); }
if (GetStat(STAT_STRENGTH) > stat)
{
trigger_spell_id = 60229; stat = GetStat(STAT_STRENGTH);
}
// agility
if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 60233; stat = GetStat(STAT_AGILITY); }
if (GetStat(STAT_AGILITY) > stat)
{
trigger_spell_id = 60233; stat = GetStat(STAT_AGILITY);
}
// intellect
if (GetStat(STAT_INTELLECT) > stat) { trigger_spell_id = 60234; stat = GetStat(STAT_INTELLECT);}
if (GetStat(STAT_INTELLECT) > stat)
{
trigger_spell_id = 60234; stat = GetStat(STAT_INTELLECT);
}
// spirit
if (GetStat(STAT_SPIRIT) > stat) { trigger_spell_id = 60235; }
if (GetStat(STAT_SPIRIT) > stat)
{
trigger_spell_id = 60235;
}
break;
}
// case 55580: break: // Mana Link
@ -3093,18 +3105,30 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
{
float stat = 0.0f;
// strength
if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 67708; stat = GetStat(STAT_STRENGTH); }
if (GetStat(STAT_STRENGTH) > stat)
{
trigger_spell_id = 67708; stat = GetStat(STAT_STRENGTH);
}
// agility
if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 67703; }
if (GetStat(STAT_AGILITY) > stat)
{
trigger_spell_id = 67703;
}
break;
}
case 67771: // Death's Choice (heroic), Item - Coliseum 25 Heroic Melee Trinket
{
float stat = 0.0f;
// strength
if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 67773; stat = GetStat(STAT_STRENGTH); }
if (GetStat(STAT_STRENGTH) > stat)
{
trigger_spell_id = 67773; stat = GetStat(STAT_STRENGTH);
}
// agility
if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 67772; }
if (GetStat(STAT_AGILITY) > stat)
{
trigger_spell_id = 67772;
}
break;
}
case 69023: // Mirrored Soul

View file

@ -106,7 +106,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvPacket)
ObjectGuid destVehicleGuid;
uint8 seat;
recvPacket >> movementInfo;
recvPacket >> movementInfo;
srcVehicleGuid = movementInfo.GetGuid();
destVehicleGuid = movementInfo.GetGuid2();
@ -194,13 +194,13 @@ void WorldSession::HandleEjectPassenger(WorldPacket& recvPacket)
void WorldSession::HandleRequestVehiclePrevSeat(WorldPacket& recv_data)
{
DEBUG_LOG("WORLD: Received CMSG_REQUEST_VEHICLE_PREV_SEAT");
// ToDo
}
void WorldSession::HandleRequestVehicleNextSeat(WorldPacket& recv_data)
{
DEBUG_LOG("WORLD: Received CMSG_REQUEST_VEHICLE_NEXT_SEAT");
// ToDo
}

View file

@ -184,7 +184,7 @@ namespace Movement
time_passed = 0;
vertical_acceleration = 0.f;
effect_start_time = 0;
// detect Stop command
if (splineflags.done)
{

View file

@ -60,10 +60,10 @@ namespace Movement
* @return int32 duration - estimated travel time
*/
int32 Launch();
/**
* @brief Stop any creature movement
*
*
*/
void Stop();
@ -113,7 +113,7 @@ namespace Movement
* @param destination
* @param generatePath
* @param forceDestination
* @param maxPathRange
* @param maxPathRange
*/
void MoveTo(const Vector3& destination, bool generatePath = false, bool forceDestination = false);
/**

View file

@ -298,7 +298,10 @@ class BIH
while (n > 0)
{
bool hit = intersectCallback(r, objects[offset], maxDist, stopAtFirst);
if (stopAtFirst && hit) { return; }
if (stopAtFirst && hit)
{
return;
}
--n;
++offset;
}

View file

@ -66,7 +66,7 @@ class BIHWrap
*/
bool operator()(const Ray& r, uint32 Idx, float& MaxDist, bool /*stopAtFirst*/)
{
if (Idx >= objects_size)
if (Idx >= objects_size)
{
return false;
}
@ -86,7 +86,7 @@ class BIHWrap
*/
void operator()(const Vector3& p, uint32 Idx)
{
if (Idx >= objects_size)
if (Idx >= objects_size)
{
return;
}

View file

@ -313,20 +313,35 @@ namespace VMAP
{
char chunk[8];
// general info
if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) { success = false; }
if (!readChunk(rf, chunk, VMAP_MAGIC, 8))
{
success = false;
}
char tiled=0;
if (success && fread(&tiled, sizeof(char), 1, rf) != 1) { success = false; }
if (success && fread(&tiled, sizeof(char), 1, rf) != 1)
{
success = false;
}
iIsTiled = bool(tiled);
// Nodes
if (success && !readChunk(rf, chunk, "NODE", 4)) { success = false; }
if (success) { success = iTree.readFromFile(rf); }
if (success && !readChunk(rf, chunk, "NODE", 4))
{
success = false;
}
if (success)
{
success = iTree.readFromFile(rf);
}
if (success)
{
iNTreeValues = iTree.primCount();
iTreeValues = new ModelInstance[iNTreeValues];
}
if (success && !readChunk(rf, chunk, "GOBJ", 4)) { success = false; }
if (success && !readChunk(rf, chunk, "GOBJ", 4))
{
success = false;
}
// global model spawns
// only non-tiled maps have them, and if so exactly one (so far at least...)
ModelSpawn spawn;

View file

@ -229,9 +229,15 @@ namespace VMAP
}
uint32 nameLen = spawn.name.length();
check += fwrite(&nameLen, sizeof(uint32), 1, wf);
if (check != uint32(has_bound ? 17 : 11)) { return false; }
if (check != uint32(has_bound ? 17 : 11))
{
return false;
}
check = fwrite(spawn.name.c_str(), sizeof(char), nameLen, wf);
if (check != nameLen) { return false; }
if (check != nameLen)
{
return false;
}
return true;
}
}

View file

@ -46,7 +46,10 @@ namespace VMAP
{
bool readChunk(FILE* rf, char* dest, const char* compare, uint32 len)
{
if (fread(dest, sizeof(char), len, rf) != len) { return false; }
if (fread(dest, sizeof(char), len, rf) != len)
{
return false;
}
return memcmp(dest, compare, len) == 0;
}
@ -130,16 +133,31 @@ namespace VMAP
}
// general info
if (success && fwrite(VMAP_MAGIC, 1, 8, mapfile) != 8) { success = false; }
if (success && fwrite(VMAP_MAGIC, 1, 8, mapfile) != 8)
{
success = false;
}
uint32 globalTileID = StaticMapTree::packTileID(65, 65);
pair<TileMap::iterator, TileMap::iterator> globalRange = map_iter->second->TileEntries.equal_range(globalTileID);
char isTiled = globalRange.first == globalRange.second; // only maps without terrain (tiles) have global WMO
if (success && fwrite(&isTiled, sizeof(char), 1, mapfile) != 1) { success = false; }
if (success && fwrite(&isTiled, sizeof(char), 1, mapfile) != 1)
{
success = false;
}
// Nodes
if (success && fwrite("NODE", 4, 1, mapfile) != 1) { success = false; }
if (success) { success = pTree.writeToFile(mapfile); }
if (success && fwrite("NODE", 4, 1, mapfile) != 1)
{
success = false;
}
if (success)
{
success = pTree.writeToFile(mapfile);
}
// global map spawns (WDT), if any (most instances)
if (success && fwrite("GOBJ", 4, 1, mapfile) != 1) { success = false; }
if (success && fwrite("GOBJ", 4, 1, mapfile) != 1)
{
success = false;
}
for (TileMap::iterator glob = globalRange.first; glob != globalRange.second && success; ++glob)
{
@ -169,9 +187,15 @@ namespace VMAP
tilefilename << std::setw(2) << x << "_" << std::setw(2) << y << ".vmtile";
FILE* tilefile = fopen(tilefilename.str().c_str(), "wb");
// file header
if (success && fwrite(VMAP_MAGIC, 1, 8, tilefile) != 8) { success = false; }
if (success && fwrite(VMAP_MAGIC, 1, 8, tilefile) != 8)
{
success = false;
}
// write number of tile spawns
if (success && fwrite(&nSpawns, sizeof(uint32), 1, tilefile) != 1) { success = false; }
if (success && fwrite(&nSpawns, sizeof(uint32), 1, tilefile) != 1)
{
success = false;
}
// write tile spawns
for (uint32 s = 0; s < nSpawns; ++s)
{
@ -183,7 +207,10 @@ namespace VMAP
success = success && ModelSpawn::writeToFile(tilefile, spawn2);
// MapTree nodes to update when loading tile:
std::map<uint32, uint32>::iterator nIdx = modelNodeIdx.find(spawn2.ID);
if (success && fwrite(&nIdx->second, sizeof(uint32), 1, tilefile) != 1) { success = false; }
if (success && fwrite(&nIdx->second, sizeof(uint32), 1, tilefile) != 1)
{
success = false;
}
}
fclose(tilefile);
}
@ -250,7 +277,10 @@ namespace VMAP
printf("spawning Map %d\n", mapID);
mapData[mapID] = current = new MapSpawns();
}
else { current = (*map_iter).second; }
else
{
current = (*map_iter).second;
}
current->UniqueEntries.insert(pair<uint32, ModelSpawn>(spawn.ID, spawn));
current->TileEntries.insert(pair<uint32, uint32>(StaticMapTree::packTileID(tileX, tileY), spawn.ID));
}

View file

@ -229,14 +229,32 @@ namespace VMAP
bool WmoLiquid::writeToFile(FILE* wf)
{
bool result = true;
if (result && fwrite(&iTilesX, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&iTilesY, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&iCorner, sizeof(Vector3), 1, wf) != 1) { result = false; }
if (result && fwrite(&iType, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&iTilesX, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
if (result && fwrite(&iTilesY, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
if (result && fwrite(&iCorner, sizeof(Vector3), 1, wf) != 1)
{
result = false;
}
if (result && fwrite(&iType, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
uint32 size = (iTilesX + 1) * (iTilesY + 1);
if (result && fwrite(iHeight, sizeof(float), size, wf) != size) { result = false; }
if (result && fwrite(iHeight, sizeof(float), size, wf) != size)
{
result = false;
}
size = iTilesX * iTilesY;
if (result && fwrite(iFlags, sizeof(uint8), size, wf) != size) { result = false; }
if (result && fwrite(iFlags, sizeof(uint8), size, wf) != size)
{
result = false;
}
return result;
}
@ -244,16 +262,34 @@ namespace VMAP
{
bool result = true;
WmoLiquid* liquid = new WmoLiquid();
if (result && fread(&liquid->iTilesX, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && fread(&liquid->iTilesY, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && fread(&liquid->iCorner, sizeof(Vector3), 1, rf) != 1) { result = false; }
if (result && fread(&liquid->iType, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && fread(&liquid->iTilesX, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (result && fread(&liquid->iTilesY, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (result && fread(&liquid->iCorner, sizeof(Vector3), 1, rf) != 1)
{
result = false;
}
if (result && fread(&liquid->iType, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
uint32 size = (liquid->iTilesX + 1) * (liquid->iTilesY + 1);
liquid->iHeight = new float[size];
if (result && fread(liquid->iHeight, sizeof(float), size, rf) != size) { result = false; }
if (result && fread(liquid->iHeight, sizeof(float), size, rf) != size)
{
result = false;
}
size = liquid->iTilesX * liquid->iTilesY;
liquid->iFlags = new uint8[size];
if (result && fread(liquid->iFlags, sizeof(uint8), size, rf) != size) { result = false; }
if (result && fread(liquid->iFlags, sizeof(uint8), size, rf) != size)
{
result = false;
}
if (!result)
{
delete liquid;
@ -290,41 +326,89 @@ namespace VMAP
bool result = true;
uint32 chunkSize, count;
if (result && fwrite(&iBound, sizeof(G3D::AABox), 1, wf) != 1) { result = false; }
if (result && fwrite(&iMogpFlags, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&iGroupWMOID, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&iBound, sizeof(G3D::AABox), 1, wf) != 1)
{
result = false;
}
if (result && fwrite(&iMogpFlags, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
if (result && fwrite(&iGroupWMOID, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
// write vertices
if (result && fwrite("VERT", 1, 4, wf) != 4) { result = false; }
if (result && fwrite("VERT", 1, 4, wf) != 4)
{
result = false;
}
count = vertices.size();
chunkSize = sizeof(uint32) + sizeof(Vector3) * count;
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&count, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
if (result && fwrite(&count, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
if (!count) // models without (collision) geometry end here, unsure if they are useful
{
return result;
}
if (result && fwrite(&vertices[0], sizeof(Vector3), count, wf) != count) { result = false; }
if (result && fwrite(&vertices[0], sizeof(Vector3), count, wf) != count)
{
result = false;
}
// write triangle mesh
if (result && fwrite("TRIM", 1, 4, wf) != 4) { result = false; }
if (result && fwrite("TRIM", 1, 4, wf) != 4)
{
result = false;
}
count = triangles.size();
chunkSize = sizeof(uint32) + sizeof(MeshTriangle) * count;
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&count, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
if (result && fwrite(&count, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
if (count)
if (result && fwrite(&triangles[0], sizeof(MeshTriangle), count, wf) != count) { result = false; }
if (result && fwrite(&triangles[0], sizeof(MeshTriangle), count, wf) != count)
{
result = false;
}
// write mesh BIH
if (result && fwrite("MBIH", 1, 4, wf) != 4) { result = false; }
if (result) { result = meshTree.writeToFile(wf); }
if (result && fwrite("MBIH", 1, 4, wf) != 4)
{
result = false;
}
if (result)
{
result = meshTree.writeToFile(wf);
}
// write liquid data
if (result && fwrite("LIQU", 1, 4, wf) != 4) { result = false; }
if (result && fwrite("LIQU", 1, 4, wf) != 4)
{
result = false;
}
chunkSize = iLiquid ? iLiquid->GetFileSize() : 0;
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
if (chunkSize)
if (result) { result = iLiquid->writeToFile(wf); }
if (result)
{
result = iLiquid->writeToFile(wf);
}
return result;
}
@ -340,38 +424,89 @@ namespace VMAP
delete iLiquid;
iLiquid = 0;
if (result && fread(&iBound, sizeof(G3D::AABox), 1, rf) != 1) { result = false; }
if (result && fread(&iMogpFlags, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && fread(&iGroupWMOID, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && fread(&iBound, sizeof(G3D::AABox), 1, rf) != 1)
{
result = false;
}
if (result && fread(&iMogpFlags, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (result && fread(&iGroupWMOID, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
// read vertices
if (result && !readChunk(rf, chunk, "VERT", 4)) { result = false; }
if (result && fread(&chunkSize, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && fread(&count, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && !readChunk(rf, chunk, "VERT", 4))
{
result = false;
}
if (result && fread(&chunkSize, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (result && fread(&count, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (!count) // models without (collision) geometry end here, unsure if they are useful
{
return result;
}
if (result) { vertices.resize(count); }
if (result && fread(&vertices[0], sizeof(Vector3), count, rf) != count) { result = false; }
if (result)
{
vertices.resize(count);
}
if (result && fread(&vertices[0], sizeof(Vector3), count, rf) != count)
{
result = false;
}
// read triangle mesh
if (result && !readChunk(rf, chunk, "TRIM", 4)) { result = false; }
if (result && fread(&chunkSize, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && fread(&count, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && !readChunk(rf, chunk, "TRIM", 4))
{
result = false;
}
if (result && fread(&chunkSize, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (result && fread(&count, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (count)
{
if (result) { triangles.resize(count); }
if (result && fread(&triangles[0], sizeof(MeshTriangle), count, rf) != count) { result = false; }
if (result)
{
triangles.resize(count);
}
if (result && fread(&triangles[0], sizeof(MeshTriangle), count, rf) != count)
{
result = false;
}
}
// read mesh BIH
if (result && !readChunk(rf, chunk, "MBIH", 4)) { result = false; }
if (result) { result = meshTree.readFromFile(rf); }
if (result && !readChunk(rf, chunk, "MBIH", 4))
{
result = false;
}
if (result)
{
result = meshTree.readFromFile(rf);
}
// read liquid data
if (result && !readChunk(rf, chunk, "LIQU", 4)) { result = false; }
if (result && fread(&chunkSize, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && !readChunk(rf, chunk, "LIQU", 4))
{
result = false;
}
if (result && fread(&chunkSize, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (result && chunkSize > 0)
{
result = WmoLiquid::readFromFile(rf, iLiquid);
@ -386,7 +521,10 @@ namespace VMAP
bool operator()(const G3D::Ray& ray, uint32 entry, float& distance, bool /*pStopAtFirstHit*/)
{
bool result = IntersectTriangle(triangles[entry], vertices, ray, distance);
if (result) { hit = true; }
if (result)
{
hit = true;
}
return hit;
}
std::vector<Vector3>::const_iterator vertices;
@ -455,7 +593,10 @@ namespace VMAP
bool operator()(const G3D::Ray& ray, uint32 entry, float& distance, bool pStopAtFirstHit)
{
bool result = models[entry].IntersectRay(ray, distance, pStopAtFirstHit);
if (result) { hit = true; }
if (result)
{
hit = true;
}
return hit;
}
std::vector<GroupModel>::const_iterator models;
@ -561,25 +702,46 @@ namespace VMAP
uint32 chunkSize, count;
bool result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8;
if (result && fwrite("WMOD", 1, 4, wf) != 4) { result = false; }
if (result && fwrite("WMOD", 1, 4, wf) != 4)
{
result = false;
}
chunkSize = sizeof(uint32) + sizeof(uint32);
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&RootWMOID, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
if (result && fwrite(&RootWMOID, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
// write group models
count = groupModels.size();
if (count)
{
if (result && fwrite("GMOD", 1, 4, wf) != 4) { result = false; }
if (result && fwrite("GMOD", 1, 4, wf) != 4)
{
result = false;
}
// chunkSize = sizeof(uint32)+ sizeof(GroupModel)*count;
// if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false;
if (result && fwrite(&count, sizeof(uint32), 1, wf) != 1) { result = false; }
if (result && fwrite(&count, sizeof(uint32), 1, wf) != 1)
{
result = false;
}
for (uint32 i = 0; i < groupModels.size() && result; ++i)
{ result = groupModels[i].writeToFile(wf); }
// write group BIH
if (result && fwrite("GBIH", 1, 4, wf) != 4) { result = false; }
if (result) { result = groupTree.writeToFile(wf); }
if (result && fwrite("GBIH", 1, 4, wf) != 4)
{
result = false;
}
if (result)
{
result = groupTree.writeToFile(wf);
}
}
fclose(wf);
@ -598,26 +760,50 @@ namespace VMAP
uint32 chunkSize = 0;
uint32 count = 0;
char chunk[8]; // Ignore the added magic header
if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) { result = false; }
if (!readChunk(rf, chunk, VMAP_MAGIC, 8))
{
result = false;
}
if (result && !readChunk(rf, chunk, "WMOD", 4)) { result = false; }
if (result && fread(&chunkSize, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && fread(&RootWMOID, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result && !readChunk(rf, chunk, "WMOD", 4))
{
result = false;
}
if (result && fread(&chunkSize, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (result && fread(&RootWMOID, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
// read group models
if (result && readChunk(rf, chunk, "GMOD", 4))
{
// if (fread(&chunkSize, sizeof(uint32), 1, rf) != 1) result = false;
if (result && fread(&count, sizeof(uint32), 1, rf) != 1) { result = false; }
if (result) { groupModels.resize(count); }
if (result && fread(&count, sizeof(uint32), 1, rf) != 1)
{
result = false;
}
if (result)
{
groupModels.resize(count);
}
// if (result && fread(&groupModels[0], sizeof(GroupModel), count, rf) != count) result = false;
for (uint32 i = 0; i < count && result; ++i)
{ result = groupModels[i].readFromFile(rf); }
// read group BIH
if (result && !readChunk(rf, chunk, "GBIH", 4)) { result = false; }
if (result) { result = groupTree.readFromFile(rf); }
if (result && !readChunk(rf, chunk, "GBIH", 4))
{
result = false;
}
if (result)
{
result = groupTree.readFromFile(rf);
}
}
fclose(rf);

View file

@ -48,7 +48,10 @@ BigNumber::BigNumber(uint32 val)
BigNumber::~BigNumber()
{
BN_free(_bn);
if (_array) { delete[] _array; }
if (_array)
{
delete[] _array;
}
}
void BigNumber::SetDword(uint32 val)

View file

@ -210,7 +210,10 @@ void Database::InitDelayThread()
void Database::HaltDelayThread()
{
if (!m_threadBody || !m_delayThread) { return; }
if (!m_threadBody || !m_delayThread)
{
return;
}
m_threadBody->Stop(); // Stop event
m_delayThread->wait(); // Wait for flush to DB
@ -329,7 +332,10 @@ bool Database::PExecuteLog(const char* format, ...)
QueryResult* Database::PQuery(const char* format, ...)
{
if (!format) { return NULL; }
if (!format)
{
return NULL;
}
va_list ap;
char szQuery [MAX_QUERY_LEN];
@ -348,7 +354,10 @@ QueryResult* Database::PQuery(const char* format, ...)
QueryNamedResult* Database::PQueryNamed(const char* format, ...)
{
if (!format) { return NULL; }
if (!format)
{
return NULL;
}
va_list ap;
char szQuery [MAX_QUERY_LEN];
@ -522,7 +531,7 @@ bool Database::CheckDatabaseVersion(DatabaseTypes database)
// db_version table does not exist or is empty
if (!result)
{
{
sLog.outErrorDb("The table `db_version` in your [%s] database is missing or corrupt.", dbversion.dbname.c_str());
sLog.outErrorDb();
sLog.outErrorDb(" [A] You have database Version: MaNGOS can not verify your database version or its existence!");
@ -571,7 +580,7 @@ bool Database::CheckDatabaseVersion(DatabaseTypes database)
sLog.outErrorDb("Current DB content is %u, core expects %u", content, dbversion.expected_content);
sLog.outErrorDb("This is ok for now but should not last long.");
}
else if (content != dbversion.expected_content)
else if (content != dbversion.expected_content)
{
sLog.outErrorDb("The table `db_version` indicates that your [%s] database does not match the expected version!", dbversion.dbname.c_str());
sLog.outErrorDb();

View file

@ -625,7 +625,7 @@ class Database
/**
* @brief Function to check that the database version matches expected core version
*
* @param DatabaseTypes
* @param DatabaseTypes
* @return bool
*/
bool CheckDatabaseVersion(DatabaseTypes database);

View file

@ -234,7 +234,10 @@ bool SqlQueryHolderEx::Execute(SqlConnection* conn)
{
/// execute all queries in the holder and pass the results
char const* sql = queries[i].first;
if (sql) { m_holder->SetResult(i, conn->Query(sql)); }
if (sql)
{
m_holder->SetResult(i, conn->Query(sql));
}
}
/// sync with the caller thread

View file

@ -73,9 +73,9 @@ enum LogType
const int LogType_count = int(LogError) + 1;
Log::Log() :
raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL), dberLogfile(NULL),
raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL), dberLogfile(NULL),
#ifdef ENABLE_ELUNA
elunaErrLogfile(NULL),
elunaErrLogfile(NULL),
#endif /* ENABLE_ELUNA */
eventAiErLogfile(NULL), scriptErrLogFile(NULL), worldLogfile(NULL), wardenLogfile(NULL), m_colored(false),
m_includeTime(false), m_gmlog_per_account(false), m_scriptLibName(NULL)

View file

@ -132,4 +132,4 @@ bool DelayExecutor::activated()
void DelayExecutor::activated(bool s)
{
activated_ = s;
}
}

View file

@ -221,7 +221,7 @@ ACE_THR_FUNC_RETURN Thread::ThreadTask(void* param)
{
Runnable* _task = static_cast<Runnable*>(param);
_task->incReference();
_task->run();
// task execution complete, free referecne added at

View file

@ -87,7 +87,10 @@ void BarGoLink::step()
int i, n;
if (num_rec == 0) { return; }
if (num_rec == 0)
{
return;
}
++rec_no;
n = rec_no * indic_len / num_rec;
if (n != rec_pos)

View file

@ -133,7 +133,10 @@ Tokens StrSplit(const std::string& src, const std::string& sep)
{
if (sep.find(*i) != std::string::npos)
{
if (s.length()) { r.push_back(s); }
if (s.length())
{
r.push_back(s);
}
s = "";
}
else
@ -141,7 +144,10 @@ Tokens StrSplit(const std::string& src, const std::string& sep)
s += *i;
}
}
if (s.length()) { r.push_back(s); }
if (s.length())
{
r.push_back(s);
}
return r;
}

View file

@ -238,7 +238,10 @@ void WINAPI ServiceMain(DWORD argc, char* argv[])
for (i = 0; i < std::strlen(path); ++i)
{
if (path[i] == '\\') { last_slash = i; }
if (path[i] == '\\')
{
last_slash = i;
}
}
path[last_slash] = 0;