aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/server/game/AI/CoreAI/PetAI.cpp30
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp3
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h2
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp5
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp4
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h13
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp54
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp6
-rwxr-xr-xsrc/server/game/Scripting/MapScripts.cpp2
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/SpellHandler.cpp5
-rwxr-xr-xsrc/server/game/Skills/SkillDiscovery.cpp30
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.h9
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp18
-rw-r--r--src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp8
-rw-r--r--src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp9
-rwxr-xr-xsrc/server/shared/Database/QueryResult.cpp5
-rwxr-xr-xsrc/server/worldserver/CommandLine/CliRunnable.cpp4
19 files changed, 118 insertions, 95 deletions
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index 115f65311b9..db6aa16910b 100755
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -317,20 +317,28 @@ Unit *PetAI::SelectNextTarget()
if (me->HasReactState(REACT_PASSIVE))
return NULL;
- Unit *target = NULL;
+ Unit *target = me->getAttackerForHelper();
targetHasCC = false;
- // Check pet's attackers first to prevent dragging mobs back
- // to owner
- if ((target = me->getAttackerForHelper()) && !_CheckTargetCC(target)) {}
- // Check owner's attackers if pet didn't have any
- else if (me->GetCharmerOrOwner() && (target = me->GetCharmerOrOwner()->getAttackerForHelper()) && !_CheckTargetCC(target)) {}
- // 3.0.2 - Pets now start attacking their owners target in defensive mode as soon as the hunter does
- else if (me->GetCharmerOrOwner() && (target = me->GetCharmerOrOwner()->getVictim()) && !_CheckTargetCC(target)) {}
- // Default
- else return NULL;
+ // Check pet's attackers first to prevent dragging mobs back to owner
+ if (target && !_CheckTargetCC(target))
+ return target;
- return target;
+ if (me->GetCharmerOrOwner())
+ {
+ // Check owner's attackers if pet didn't have any
+ target = me->GetCharmerOrOwner()->getAttackerForHelper();
+ if (target && !_CheckTargetCC(target))
+ return target;
+
+ // 3.0.2 - Pets now start attacking their owners target in defensive mode as soon as the hunter does
+ target = me->GetCharmerOrOwner()->getVictim();
+ if (target && !_CheckTargetCC(target))
+ return target;
+ }
+
+ // Default
+ return NULL;
}
void PetAI::HandleReturnMovement()
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 127994648cc..31fedb11699 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -316,7 +316,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
}
else
{
- switch (e.event.type)
+ uint32 type = e.event.type;
+ switch (type)
{
case SMART_EVENT_UPDATE:
case SMART_EVENT_UPDATE_IC:
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index ec02d44b607..01568ee41f0 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -149,7 +149,7 @@ enum SMART_EVENT
SMART_EVENT_GOSSIP_SELECT = 62, //1 // menuID, actionID
SMART_EVENT_JUST_CREATED = 63, //1 // none
SMART_EVENT_GOSSIP_HELLO = 64, //1 // none
- SMART_EVENT_FOLLOW_COMPLETED = 65, //1 // none
+ SMART_EVENT_FOLLOW_COMPLETED = 65, //1 // none
SMART_EVENT_DUMMY_EFFECT = 66, //1 // spellId, effectIndex
SMART_EVENT_END = 67,
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
index 6625d954127..a50fae33b19 100755
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ b/src/server/game/Chat/Commands/Level3.cpp
@@ -4122,8 +4122,11 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args)
uint16 MapId = 0;
if (strcmp(pMap, "all"))
- if (!(MapId = uint16(atoi(pMap))))
+ {
+ MapId = uint16(atoi(pMap));
+ if (!MapId)
return false;
+ }
for(uint8 i = 0; i < MAX_DIFFICULTY; ++i)
{
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 52f24381d96..e3e3936009c 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -2753,10 +2753,10 @@ void Player::GiveLevel(uint8 level)
sScriptMgr->OnPlayerLevelChanged(this, level);
PlayerLevelInfo info;
- sObjectMgr->GetPlayerLevelInfo(getRace(),getClass(),level,&info);
+ sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info);
PlayerClassLevelInfo classInfo;
- sObjectMgr->GetPlayerClassLevelInfo(getClass(),level,&classInfo);
+ sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, &classInfo);
// send levelup info to client
WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_POWERS*4+MAX_STATS*4));
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 8ee626d18bb..3052e98f9ce 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -2732,10 +2732,11 @@ void AddItemsSetItem(Player*player,Item *item);
void RemoveItemsSetItem(Player*player,ItemPrototype const *proto);
// "the bodies of template functions must be made available in a header file"
-template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell * spell)
+template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell)
{
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
- if (!spellInfo) return 0;
+ SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
+ if (!spellInfo)
+ return 0;
float totalmul = 1.0f;
int32 totalflat = 0;
@@ -2751,7 +2752,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
if (!mod->ownerAura)
ASSERT(mod->charges == 0);
- if (!IsAffectedBySpellmod(spellInfo,mod,spell))
+ if (!IsAffectedBySpellmod(spellInfo, mod, spell))
continue;
if (mod->type == SPELLMOD_FLAT)
@@ -2762,8 +2763,8 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
if (basevalue == T(0))
continue;
- // special case (skip >10sec spell casts for instant cast setting)
- if (mod->op == SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100)
+ // special case (skip > 10sec spell casts for instant cast setting)
+ if (mod->op == SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100)
continue;
AddPctN(totalmul, mod->value);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 3afd186ae65..2ddce4bd1a4 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -16178,7 +16178,7 @@ uint32 Unit::GetCombatRatingDamageReduction(CombatRating cr, float rate, float c
uint32 Unit::GetModelForForm(ShapeshiftForm form)
{
- switch(form)
+ switch (form)
{
case FORM_CAT:
// Based on Hair color
@@ -16347,39 +16347,39 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form)
return 21243;
return 21244;
default:
+ break;
+ }
+
+ uint32 modelid = 0;
+ SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form);
+ if (formEntry && formEntry->modelID_A)
+ {
+ // Take the alliance modelid as default
+ if (GetTypeId() != TYPEID_PLAYER)
+ return formEntry->modelID_A;
+ else
{
- uint32 modelid = 0;
- SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form);
- if (formEntry && formEntry->modelID_A)
- {
- // Take the alliance modelid as default
- if (GetTypeId() != TYPEID_PLAYER)
- return formEntry->modelID_A;
- else
- {
- if (Player::TeamForRace(getRace()) == ALLIANCE)
- modelid = formEntry->modelID_A;
- else
- modelid = formEntry->modelID_H;
+ if (Player::TeamForRace(getRace()) == ALLIANCE)
+ modelid = formEntry->modelID_A;
+ else
+ modelid = formEntry->modelID_H;
- // If the player is horde but there are no values for the horde modelid - take the alliance modelid
- if (!modelid && Player::TeamForRace(getRace()) == HORDE)
- modelid = formEntry->modelID_A;
- }
- }
- return modelid;
+ // If the player is horde but there are no values for the horde modelid - take the alliance modelid
+ if (!modelid && Player::TeamForRace(getRace()) == HORDE)
+ modelid = formEntry->modelID_A;
}
}
- return 0;
+
+ return modelid;
}
uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
{
- switch(getRace())
+ switch (getRace())
{
case RACE_ORC:
{
- switch(totemType)
+ switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 30758;
@@ -16394,7 +16394,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
}
case RACE_DWARF:
{
- switch(totemType)
+ switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 30754;
@@ -16409,7 +16409,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
}
case RACE_TROLL:
{
- switch(totemType)
+ switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 30762;
@@ -16424,7 +16424,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
}
case RACE_TAUREN:
{
- switch(totemType)
+ switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 4589;
@@ -16439,7 +16439,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
}
case RACE_DRAENEI:
{
- switch(totemType)
+ switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 19074;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 9e5350124b0..ae028b7b7a1 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -197,8 +197,8 @@ LanguageDesc const* GetLanguageDescByID(uint32 lang)
bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clickee) const
{
- Player const* playerClicker = NULL;
- if (playerClicker = clicker->ToPlayer())
+ Player const* playerClicker = clicker->ToPlayer();
+ if (playerClicker)
{
if (questStart)
{
@@ -6736,7 +6736,7 @@ uint32 ObjectMgr::GenerateAuctionID()
uint64 ObjectMgr::GenerateEquipmentSetGuid()
{
- if (m_equipmentSetGuid >= 0xFFFFFFFFFFFFFFFEll)
+ if (m_equipmentSetGuid >= uint64(0xFFFFFFFFFFFFFFFELL))
{
sLog->outError("EquipmentSet guid overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index 507e40b67d3..7460acf43ef 100755
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -324,7 +324,7 @@ void Map::ScriptsProcess()
{
if ((*iter)->GetGUID() == step.sourceGUID)
{
- source = reinterpret_cast<Object*>(*iter);
+ source = *iter;
break;
}
}
diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
index 062d7fae437..862a2ed0e27 100755
--- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
@@ -544,7 +544,7 @@ void WorldSession::HandleSelfResOpcode(WorldPacket & /*recv_data*/)
}
}
-void WorldSession::HandleSpellClick(WorldPacket & recv_data)
+void WorldSession::HandleSpellClick(WorldPacket& recv_data)
{
uint64 guid;
recv_data >> guid;
@@ -559,8 +559,7 @@ void WorldSession::HandleSpellClick(WorldPacket & recv_data)
if (!unit->IsInWorld())
return;
- bool unusedReturnValue = unit->HandleSpellClick(_player);
- // ^ ignore compiler warning
+ unit->HandleSpellClick(_player);
}
void WorldSession::HandleMirrrorImageDataRequest(WorldPacket & recv_data)
diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp
index c2af8dd1e48..973d37b90cc 100755
--- a/src/server/game/Skills/SkillDiscovery.cpp
+++ b/src/server/game/Skills/SkillDiscovery.cpp
@@ -70,7 +70,7 @@ void LoadSkillDiscoveryTable()
uint32 spellId = fields[0].GetUInt32();
int32 reqSkillOrSpell = fields[1].GetInt32();
- uint32 reqSkillValue = fields[2].GetInt32();
+ uint32 reqSkillValue = fields[2].GetUInt32();
float chance = fields[3].GetFloat();
if (chance <= 0) // chance
@@ -82,13 +82,14 @@ void LoadSkillDiscoveryTable()
if (reqSkillOrSpell > 0) // spell case
{
- SpellEntry const* reqSpellEntry = sSpellStore.LookupEntry(reqSkillOrSpell);
+ uint32 absReqSkillOrSpell = uint32(reqSkillOrSpell);
+ SpellEntry const* reqSpellEntry = sSpellStore.LookupEntry(absReqSkillOrSpell);
if (!reqSpellEntry)
{
- if (reportedReqSpells.find(reqSkillOrSpell) == reportedReqSpells.end())
+ if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
sLog->outErrorDb("Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table",spellId,reqSkillOrSpell);
- reportedReqSpells.insert(reqSkillOrSpell);
+ reportedReqSpells.insert(absReqSkillOrSpell);
}
continue;
}
@@ -98,12 +99,12 @@ void LoadSkillDiscoveryTable()
// explicit discovery ability
!IsExplicitDiscoverySpell(reqSpellEntry))
{
- if (reportedReqSpells.find(reqSkillOrSpell) == reportedReqSpells.end())
+ if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
sLog->outErrorDb("Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
" and not 100%% chance random discovery ability but listed for spellId %u (and maybe more) in `skill_discovery_template` table",
- reqSkillOrSpell,spellId);
- reportedReqSpells.insert(reqSkillOrSpell);
+ absReqSkillOrSpell, spellId);
+ reportedReqSpells.insert(absReqSkillOrSpell);
}
continue;
}
@@ -146,7 +147,7 @@ void LoadSkillDiscoveryTable()
if (!IsExplicitDiscoverySpell(spellEntry))
continue;
- if (SkillDiscoveryStore.find(spell_id) == SkillDiscoveryStore.end())
+ if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end())
sLog->outErrorDb("Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table",spell_id);
}
@@ -158,12 +159,12 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
{
// explicit discovery spell chances (always success if case exist)
// in this case we have both skill and spell
- SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(spellId);
+ SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(int32(spellId));
if (tab == SkillDiscoveryStore.end())
return 0;
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId);
- uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : 0;
+ uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : uint32(0);
float full_chance = 0;
for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
@@ -193,13 +194,10 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
bool HasDiscoveredAllSpells(uint32 spellId, Player* player)
{
- SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(spellId);
+ SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(int32(spellId));
if (tab == SkillDiscoveryStore.end())
return true;
- SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId);
- uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : 0;
-
for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
if (!player->HasSpell(item_iter->spellId))
return false;
@@ -209,10 +207,10 @@ bool HasDiscoveredAllSpells(uint32 spellId, Player* player)
uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
{
- uint32 skillvalue = skillId ? player->GetSkillValue(skillId) : 0;
+ uint32 skillvalue = skillId ? player->GetSkillValue(skillId) : uint32(0);
// check spell case
- SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(spellId);
+ SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(int32(spellId));
if (tab != SkillDiscoveryStore.end())
{
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index 1e2e6035a7e..031b77f0bd6 100755
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -537,7 +537,7 @@ inline uint32 GetDispellMask(DispelType dispel)
if (dispel == DISPEL_ALL)
return DISPEL_ALL_MASK;
else
- return (1 << dispel);
+ return uint32(1 << dispel);
}
// Diminishing Returns interaction with spells
@@ -1087,16 +1087,15 @@ class SpellMgr
}
if (SpellDiff->SpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC)
{
- uint8 baseMode = mode;
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "GetSpellForDifficultyFromSpell: spell %u mode %u spell is NULL, using mode %u", spell->Id, mode, mode-2);
mode -= 2;
- sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "GetSpellForDifficultyFromSpell: spell %u mode %u spell is NULL, using mode %u", spell->Id, baseMode, mode);
}
if (SpellDiff->SpellID[mode] <= 0)
{
sLog->outErrorDb("GetSpellForDifficultyFromSpell: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spell->Id, mode);
return spell;
}
- SpellEntry const* newSpell = sSpellStore.LookupEntry(SpellDiff->SpellID[mode]);
+ SpellEntry const* newSpell = sSpellStore.LookupEntry(uint32(SpellDiff->SpellID[mode]));
if (!newSpell)
{
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "GetSpellForDifficultyFromSpell: spell %u not found in SpellStore. Check spelldifficulty_dbc!", SpellDiff->SpellID[mode]);
@@ -1198,7 +1197,7 @@ class SpellMgr
return spell_id;
}
- uint32 IsArenaAllowedEnchancment(uint32 ench_id) const
+ bool IsArenaAllowedEnchancment(uint32 ench_id) const
{
return mEnchantCustomAttr[ench_id];
}
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
index eb8a525f875..273fa33414f 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
@@ -182,7 +182,7 @@ class npc_azure_ring_captain : public CreatureScript
}
}
- void UpdateAI(const uint32 diff)
+ void UpdateAI(const uint32 /*diff*/)
{
if (!UpdateVictim())
return;
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
index 835c73912e7..2511a509aaf 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
@@ -81,6 +81,10 @@ public:
}
}
+ void ProcessEvent(GameObject* /*go*/, uint32 /*eventId*/)
+ {
+ }
+
void ProcessEvent(Unit* /*unit*/, uint32 eventId)
{
if (eventId != EVENT_CALL_DRAGON)
diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp
index d0acb967238..a021a9ba6e0 100644
--- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp
+++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp
@@ -76,8 +76,8 @@ enum eEvents
EVENT_BERSERK = 6,
};
-#define ACHIEVEMENT_SMELL_SARONITE RAID_MODE(3181, 3188)
-#define ACHIEVEMENT_SHADOWDODGER RAID_MODE(2996, 2997)
+#define ACHIEVEMENT_SMELL_SARONITE RAID_MODE<uint32>(3181, 3188)
+#define ACHIEVEMENT_SHADOWDODGER RAID_MODE<uint32>(2996, 2997)
class boss_general_vezax : public CreatureScript
{
@@ -156,16 +156,18 @@ public:
events.ScheduleEvent(EVENT_SEARING_FLAMES, urand(14000, 17500));
break;
case EVENT_MARK_OF_THE_FACELESS:
- Unit* pTarget;
+ {
/* He will not cast this on players within 15 yards of him.
However, if there are not at least 9 people outside of 15 yards
he will start casting it on players inside 15 yards melee and tank included.
*/
- if (!(pTarget = CheckPlayersInRange(RAID_MODE(4,9), 15.0f, 50.f)))
- pTarget = SelectTarget(SELECT_TARGET_RANDOM);
- DoCast(pTarget, SPELL_MARK_OF_THE_FACELESS);
+ Unit* target = CheckPlayersInRange(RAID_MODE<uint32>(4,9), 15.0f, 50.f);
+ if (!target)
+ target = SelectTarget(SELECT_TARGET_RANDOM);
+ DoCast(target, SPELL_MARK_OF_THE_FACELESS);
events.ScheduleEvent(EVENT_MARK_OF_THE_FACELESS, urand(35000, 45000));
break;
+ }
case EVENT_SURGE_OF_DARKNESS:
DoScriptText(EMOTE_SURGE_OF_DARKNESS, me);
DoScriptText(SAY_SURGE_OF_DARKNESS, me);
@@ -261,9 +263,9 @@ public:
Purpose: If there are uiPlayersMin people within uiRangeMin, uiRangeMax: return a random players in that range.
If not, return NULL and allow other target selection
*/
- Unit * CheckPlayersInRange(uint32 uiPlayersMin, float uiRangeMin, float uiRangeMax)
+ Unit* CheckPlayersInRange(uint32 uiPlayersMin, float uiRangeMin, float uiRangeMax)
{
- Map * pMap = me->GetMap();
+ Map* pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
std::list<Player*> PlayerList;
diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp
index c4538abffd9..3523b53835f 100644
--- a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp
@@ -253,13 +253,13 @@ public:
}
}
- void ProcessEvent(GameObject* /*go*/, uint32 uiEventId)
+ void ProcessEvent(GameObject* /*go*/, uint32 eventId)
{
// Flame Leviathan's Tower Event triggers
Creature* pFlameLeviathan = instance->GetCreature(uiLeviathanGUID);
if (pFlameLeviathan && pFlameLeviathan->isAlive()) //No leviathan, no event triggering ;)
- switch(uiEventId)
+ switch(eventId)
{
case EVENT_TOWER_OF_STORM_DESTROYED:
pFlameLeviathan->AI()->DoAction(1);
@@ -276,6 +276,10 @@ public:
}
}
+ void ProcessEvent(Unit* /*unit*/, uint32 /*eventId*/)
+ {
+ }
+
bool SetBossState(uint32 type, EncounterState state)
{
if (!InstanceScript::SetBossState(type, state))
diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
index a0d5eb3d173..a6d6e3e4f39 100644
--- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
+++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
@@ -798,16 +798,19 @@ public:
void ProcessEvent(GameObject* /*pGO*/, uint32 uiEventId)
{
- switch(uiEventId)
+ switch (uiEventId)
{
case EVENT_ACTIVATE_CRYSTAL:
bCrystalActivated = true; // Activation by player's will throw event signal
ActivateCrystal();
break;
}
- }
+ }
-};
+ void ProcessEvent(Unit* /*unit*/, uint32 /*eventId*/)
+ {
+ }
+ };
};
diff --git a/src/server/shared/Database/QueryResult.cpp b/src/server/shared/Database/QueryResult.cpp
index a38e605fcf2..9c6ad20222e 100755
--- a/src/server/shared/Database/QueryResult.cpp
+++ b/src/server/shared/Database/QueryResult.cpp
@@ -65,8 +65,8 @@ m_length(NULL)
//- This is where we prepare the buffer based on metadata
uint32 i = 0;
- MYSQL_FIELD* field;
- while ((field = mysql_fetch_field(m_res)))
+ MYSQL_FIELD* field = mysql_fetch_field(m_res);
+ while (field)
{
size_t size = Field::SizeForType(field);
@@ -80,6 +80,7 @@ m_length(NULL)
m_rBind[i].is_unsigned = field->flags & UNSIGNED_FLAG;
++i;
+ field = mysql_fetch_field(m_res);
}
//- This is where we bind the bind the buffer to the statement
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index a7775291834..957191c693a 100755
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -600,14 +600,14 @@ void CliRunnable::run()
if (!*command_str)
{
- #if PLATFORM == WINDOWS
+ #if PLATFORM == PLATFORM_WINDOWS
printf("TC>");
#endif
continue;
}
std::string command;
- if (!consoleToUtf8(command_str,command)) // convert from console encoding to utf8
+ if (!consoleToUtf8(command_str, command)) // convert from console encoding to utf8
{
#if PLATFORM == PLATFORM_WINDOWS
printf("TC>");