aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2013-09-05 16:46:14 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2013-09-05 16:46:14 +0200
commitd25c2e7f5b6ac7bb79960037cc728a46450d5609 (patch)
treea8d7f053a8d518423316e533958cdc79c714ab0d /src/server/game
parent6514e21b7cd8ec3ef7c0c44653d99245b3f57012 (diff)
parent458f5b9502da9f861ba729142dd63c3a98191ece (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/AI/SmartScripts/SmartScriptMgr.cpp src/server/game/Battlegrounds/BattlegroundMgr.cpp src/server/game/Guilds/Guild.h src/server/game/Spells/SpellMgr.cpp src/tools/map_extractor/loadlib.cpp
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/AI/CreatureAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp23
-rw-r--r--src/server/game/Battlefield/Battlefield.cpp2
-rw-r--r--src/server/game/Battlefield/Battlefield.h2
-rw-r--r--src/server/game/Battlefield/BattlefieldMgr.cpp7
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.h6
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp87
-rw-r--r--src/server/game/Calendar/CalendarMgr.h6
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.cpp14
-rw-r--r--src/server/game/Entities/Item/Item.cpp2
-rw-r--r--src/server/game/Entities/Object/Object.h2
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp6
-rw-r--r--src/server/game/Globals/ObjectMgr.h4
-rw-r--r--src/server/game/Guilds/Guild.cpp2
-rw-r--r--src/server/game/Guilds/Guild.h2
-rw-r--r--src/server/game/Loot/LootMgr.cpp2
-rw-r--r--src/server/game/Loot/LootMgr.h2
-rw-r--r--src/server/game/Maps/Map.cpp7
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp7
-rw-r--r--src/server/game/Spells/SpellEffects.cpp23
-rw-r--r--src/server/game/Spells/SpellMgr.cpp10
21 files changed, 114 insertions, 104 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index cbb79b47958..75a1488ed45 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -75,6 +75,8 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
}
}
+ // Intended duplicated check, the code above this should select a victim
+ // If it can't find a suitable attack target then we should error out.
if (!creature->HasReactState(REACT_PASSIVE) && !creature->GetVictim())
{
TC_LOG_ERROR(LOG_FILTER_GENERAL, "DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry());
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 76b87067bd9..c93ffe90add 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -785,8 +785,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
uint32 creatureSummonEntry = spellInfo->Effects[j].MiscValue;
if (e.action.killedMonster.creature == creatureSummonEntry)
- TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u summon: %u has already summon spell (SpellId: %u effect: %u)",
- e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.killedMonster.creature, spellInfo->Id, j);
+ TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u creature summon: %u has already summon spell (SpellId: %u effect: %u)",
+ e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.killedMonster.creature, spellInfo->Id, j);
}
}
}
@@ -848,6 +848,25 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SUMMON_GO:
if (!IsGameObjectValid(e, e.action.summonGO.entry))
return false;
+
+ for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
+ {
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i);
+ if (!spellInfo)
+ continue;
+
+ for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
+ {
+ if (spellInfo->Effects[j].Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD)
+ {
+ uint32 goSummonEntry = spellInfo->Effects[j].MiscValue;
+
+ if (e.action.summonGO.entry == goSummonEntry)
+ TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u gameobject summon: %u has already summon spell (SpellId: %u effect: %u)",
+ e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonGO.entry, spellInfo->Id, j);
+ }
+ }
+ }
break;
case SMART_ACTION_ADD_ITEM:
case SMART_ACTION_REMOVE_ITEM:
diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp
index bff46b9de73..3deb9cd7c46 100644
--- a/src/server/game/Battlefield/Battlefield.cpp
+++ b/src/server/game/Battlefield/Battlefield.cpp
@@ -810,7 +810,7 @@ bool BfGraveyard::HasNpc(uint64 guid)
// ********************** Misc ***************************
// *******************************************************
-Creature* Battlefield::SpawnCreature(uint32 entry, Position pos, TeamId team)
+Creature* Battlefield::SpawnCreature(uint32 entry, const Position& pos, TeamId team)
{
return SpawnCreature(entry, pos.m_positionX, pos.m_positionY, pos.m_positionZ, pos.m_orientation, team);
}
diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h
index 9b3542fca65..fd8e294a426 100644
--- a/src/server/game/Battlefield/Battlefield.h
+++ b/src/server/game/Battlefield/Battlefield.h
@@ -288,7 +288,7 @@ class Battlefield : public ZoneScript
// Misc methods
Creature* SpawnCreature(uint32 entry, float x, float y, float z, float o, TeamId team);
- Creature* SpawnCreature(uint32 entry, Position pos, TeamId team);
+ Creature* SpawnCreature(uint32 entry, const Position& pos, TeamId team);
GameObject* SpawnGameObject(uint32 entry, float x, float y, float z, float o);
Creature* GetCreature(uint64 GUID);
diff --git a/src/server/game/Battlefield/BattlefieldMgr.cpp b/src/server/game/Battlefield/BattlefieldMgr.cpp
index 28a72152e9d..53b3ce0a6d9 100644
--- a/src/server/game/Battlefield/BattlefieldMgr.cpp
+++ b/src/server/game/Battlefield/BattlefieldMgr.cpp
@@ -74,11 +74,12 @@ void BattlefieldMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid)
if (itr == m_BattlefieldMap.end())
return;
- if (itr->second->HasPlayer(player) || !itr->second->IsEnabled())
+ Battlefield* bf = itr->second;
+ if (bf->HasPlayer(player) || !bf->IsEnabled())
return;
- itr->second->HandlePlayerEnterZone(player, zoneid);
- TC_LOG_DEBUG(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId());
+ bf->HandlePlayerEnterZone(player, zoneid);
+ TC_LOG_DEBUG(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), bf->GetTypeId());
}
void BattlefieldMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid)
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h
index dbfe3b3c763..1c959d0e8c1 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.h
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h
@@ -579,8 +579,8 @@ struct WintergraspBuildingSpawnData
struct WintergraspRebuildableBuildingData
{
- uint32 entry;
uint64 Guid;
+ uint32 entry;
uint32 WorldState;
float x;
float y;
@@ -1559,7 +1559,7 @@ struct WintergraspWorkshopData
}
// Spawning associate creature and store them
- void AddCreature(WintergraspObjectPositionData obj)
+ void AddCreature(const WintergraspObjectPositionData& obj)
{
if (Creature* creature = m_WG->SpawnCreature(obj.entryHorde, obj.x, obj.y, obj.z, obj.o, TEAM_HORDE))
m_CreatureOnPoint[TEAM_HORDE].insert(creature->GetGUID());
@@ -1569,7 +1569,7 @@ struct WintergraspWorkshopData
}
// Spawning Associate gameobject and store them
- void AddGameObject(WintergraspObjectPositionData obj)
+ void AddGameObject(const WintergraspObjectPositionData& obj)
{
if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o))
m_GameObjectOnPoint[TEAM_HORDE].insert(gameobject->GetGUID());
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index 9352b2d5710..f3df064cb77 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -384,8 +384,10 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true));
continue;
}
+
Player* player = ObjectAccessor::FindPlayer(itr->first);
ObjectGuid playerGUID = itr->first;
+ BattlegroundScore* score = itr->second;
data->WriteBit(0); // Unk 1
data->WriteBit(0); // Unk 2
@@ -402,18 +404,18 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
data->WriteBit(player->GetBGTeam() == HORDE ? 0 : 1);
data->WriteBit(playerGUID[7]);
- buff << uint32(itr->second->HealingDone); // healing done
- buff << uint32(itr->second->DamageDone); // damage done
+ buff << uint32(score->HealingDone); // healing done
+ buff << uint32(score->DamageDone); // damage done
if (!isArena)
{
- buff << uint32(itr->second->BonusHonor / 100);
- buff << uint32(itr->second->Deaths);
- buff << uint32(itr->second->HonorableKills);
+ buff << uint32(score->BonusHonor / 100);
+ buff << uint32(score->Deaths);
+ buff << uint32(score->HonorableKills);
}
buff.WriteByteSeq(playerGUID[4]);
- buff << uint32(itr->second->KillingBlows);
+ buff << uint32(score->KillingBlows);
// if (unk 5) << uint32() unk
buff.WriteByteSeq(playerGUID[5]);
// if (unk 6) << uint32() unk
@@ -421,7 +423,6 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
buff.WriteByteSeq(playerGUID[1]);
buff.WriteByteSeq(playerGUID[6]);
-
buff << int32(player->GetPrimaryTalentTree(player->GetActiveSpec()));
switch (bg->GetTypeID(true)) // Custom values
@@ -431,45 +432,45 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
{
case 489:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundWGScore*)itr->second)->FlagCaptures); // flag captures
- buff << uint32(((BattlegroundWGScore*)itr->second)->FlagReturns); // flag returns
+ buff << uint32(((BattlegroundWGScore*)score)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundWGScore*)score)->FlagReturns); // flag returns
break;
case 566:
data->WriteBits(0x00000001, 24);
- buff << uint32(((BattlegroundEYScore*)itr->second)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundEYScore*)score)->FlagCaptures); // flag captures
break;
case 529:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundABScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundABScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundABScore*)score)->BasesDefended); // bases defended
break;
case 30:
data->WriteBits(0x00000005, 24);
- buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsAssaulted); // GraveyardsAssaulted
- buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsDefended); // GraveyardsDefended
- buff << uint32(((BattlegroundAVScore*)itr->second)->TowersAssaulted); // TowersAssaulted
- buff << uint32(((BattlegroundAVScore*)itr->second)->TowersDefended); // TowersDefended
- buff << uint32(((BattlegroundAVScore*)itr->second)->MinesCaptured); // MinesCaptured
+ buff << uint32(((BattlegroundAVScore*)score)->GraveyardsAssaulted); // GraveyardsAssaulted
+ buff << uint32(((BattlegroundAVScore*)score)->GraveyardsDefended); // GraveyardsDefended
+ buff << uint32(((BattlegroundAVScore*)score)->TowersAssaulted); // TowersAssaulted
+ buff << uint32(((BattlegroundAVScore*)score)->TowersDefended); // TowersDefended
+ buff << uint32(((BattlegroundAVScore*)score)->MinesCaptured); // MinesCaptured
break;
case 607:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundSAScore*)itr->second)->demolishers_destroyed);
- buff << uint32(((BattlegroundSAScore*)itr->second)->gates_destroyed);
+ buff << uint32(((BattlegroundSAScore*)score)->demolishers_destroyed);
+ buff << uint32(((BattlegroundSAScore*)score)->gates_destroyed);
break;
case 628: // IC
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundICScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundICScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundICScore*)score)->BasesDefended); // bases defended
break;
case 726:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundTPScore*)itr->second)->FlagCaptures); // flag captures
- buff << uint32(((BattlegroundTPScore*)itr->second)->FlagReturns); // flag returns
+ buff << uint32(((BattlegroundTPScore*)score)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundTPScore*)score)->FlagReturns); // flag returns
break;
case 761:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundBFGScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundBFGScore*)score)->BasesDefended); // bases defended
break;
default:
data->WriteBits(0, 24);
@@ -478,45 +479,45 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
break;
case BATTLEGROUND_AV:
data->WriteBits(0x00000005, 24);
- buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsAssaulted); // GraveyardsAssaulted
- buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsDefended); // GraveyardsDefended
- buff << uint32(((BattlegroundAVScore*)itr->second)->TowersAssaulted); // TowersAssaulted
- buff << uint32(((BattlegroundAVScore*)itr->second)->TowersDefended); // TowersDefended
- buff << uint32(((BattlegroundAVScore*)itr->second)->MinesCaptured); // MinesCaptured
+ buff << uint32(((BattlegroundAVScore*)score)->GraveyardsAssaulted); // GraveyardsAssaulted
+ buff << uint32(((BattlegroundAVScore*)score)->GraveyardsDefended); // GraveyardsDefended
+ buff << uint32(((BattlegroundAVScore*)score)->TowersAssaulted); // TowersAssaulted
+ buff << uint32(((BattlegroundAVScore*)score)->TowersDefended); // TowersDefended
+ buff << uint32(((BattlegroundAVScore*)score)->MinesCaptured); // MinesCaptured
break;
case BATTLEGROUND_WS:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundWGScore*)itr->second)->FlagCaptures); // flag captures
- buff << uint32(((BattlegroundWGScore*)itr->second)->FlagReturns); // flag returns
+ buff << uint32(((BattlegroundWGScore*)score)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundWGScore*)score)->FlagReturns); // flag returns
break;
case BATTLEGROUND_AB:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundABScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundABScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundABScore*)score)->BasesDefended); // bases defended
break;
case BATTLEGROUND_EY:
data->WriteBits(0x00000001, 24);
- buff << uint32(((BattlegroundEYScore*)itr->second)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundEYScore*)score)->FlagCaptures); // flag captures
break;
case BATTLEGROUND_SA:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundSAScore*)itr->second)->demolishers_destroyed);
- buff << uint32(((BattlegroundSAScore*)itr->second)->gates_destroyed);
+ buff << uint32(((BattlegroundSAScore*)score)->demolishers_destroyed);
+ buff << uint32(((BattlegroundSAScore*)score)->gates_destroyed);
break;
case BATTLEGROUND_IC:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundICScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundICScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundICScore*)score)->BasesDefended); // bases defended
break;
case BATTLEGROUND_TP:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundTPScore*)itr->second)->FlagCaptures); // flag captures
- buff << uint32(((BattlegroundTPScore*)itr->second)->FlagReturns); // flag returns
+ buff << uint32(((BattlegroundTPScore*)score)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundTPScore*)score)->FlagReturns); // flag returns
break;
case BATTLEGROUND_BFG:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundBFGScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundBFGScore*)score)->BasesDefended); // bases defended
break;
case BATTLEGROUND_NA:
case BATTLEGROUND_BE:
diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h
index fac5a59d2f1..1974804e230 100644
--- a/src/server/game/Calendar/CalendarMgr.h
+++ b/src/server/game/Calendar/CalendarMgr.h
@@ -166,7 +166,7 @@ struct CalendarInvite
void SetStatusTime(time_t statusTime) { _statusTime = statusTime; }
time_t GetStatusTime() const { return _statusTime; }
- void SetText(std::string text) { _text = text; }
+ void SetText(const std::string& text) { _text = text; }
std::string GetText() const { return _text; }
void SetStatus(CalendarInviteStatus status) { _status = status; }
@@ -223,10 +223,10 @@ struct CalendarEvent
void SetGuildId(uint32 guildId) { _guildId = guildId; }
uint32 GetGuildId() const { return _guildId; }
- void SetTitle(std::string title) { _title = title; }
+ void SetTitle(const std::string& title) { _title = title; }
std::string GetTitle() const { return _title; }
- void SetDescription(std::string description) { _description = description; }
+ void SetDescription(const std::string& description) { _description = description; }
std::string GetDescription() const { return _description; }
void SetType(CalendarEventType type) { _type = type; }
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp
index f8966ba1923..2a3829b7aeb 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.cpp
+++ b/src/server/game/Entities/Creature/CreatureGroups.cpp
@@ -176,18 +176,20 @@ void CreatureGroup::MemberAttackStart(Creature* member, Unit* target)
if (m_leader) // avoid crash if leader was killed and reset.
TC_LOG_DEBUG(LOG_FILTER_UNITS, "GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId());
- //Skip one check
- if (itr->first == member)
+ Creature* other = itr->first;
+
+ // Skip self
+ if (other == member)
continue;
- if (!itr->first->IsAlive())
+ if (!other->IsAlive())
continue;
- if (itr->first->GetVictim())
+ if (other->GetVictim())
continue;
- if (itr->first->IsValidAttackTarget(target) && itr->first->AI())
- itr->first->AI()->AttackStart(target);
+ if (other->IsValidAttackTarget(target))
+ other->AI()->AttackStart(target);
}
}
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index ca87d6b4a19..f1180df1813 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1539,7 +1539,7 @@ void Item::ItemContainerSaveLootToDB()
trans->Append(stmt_items);
// Now insert the items
- for (LootItemList::const_iterator _li = loot.items.begin(); _li != loot.items.end(); _li++)
+ for (LootItemList::const_iterator _li = loot.items.begin(); _li != loot.items.end(); ++_li)
{
// When an item is looted, it doesn't get removed from the items collection
// but we don't want to resave it.
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index e7f7be356a6..3c0f7adcfd8 100644
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -512,7 +512,7 @@ struct MovementInfo
float splineElevation;
MovementInfo() :
- guid(0), flags(0), flags2(0), time(0), pitch(0.0f)
+ guid(0), flags(0), flags2(0), time(0), pitch(0.0f), splineElevation(0.0f)
{
pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
transport.Reset();
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index b7321b7c51d..81fac51132a 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1758,7 +1758,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float
return guid;
}
-bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos)
+bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, const Position& pos)
{
CreatureData& data = NewOrExistCreatureData(guid);
if (!data.id)
@@ -7331,7 +7331,7 @@ static LanguageType GetRealmLanguageType(bool create)
}
}
-bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bool create = false)
+bool isValidString(const std::wstring& wstr, uint32 strictMask, bool numericOrSpace, bool create = false)
{
if (strictMask == 0) // any language, ignore realm
{
@@ -7635,7 +7635,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& names)
+bool ObjectMgr::CheckDeclinedNames(const std::wstring& w_ownname, DeclinedName const& names)
{
// get main part of the name
std::wstring mainpart = GetMainPartOfName(w_ownname, 0);
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 622fbe339e4..99833a0a264 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -1134,7 +1134,7 @@ class ObjectMgr
void RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data);
uint32 AddGOData(uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0, float rotation0 = 0, float rotation1 = 0, float rotation2 = 0, float rotation3 = 0);
uint32 AddCreData(uint32 entry, uint32 team, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0);
- bool MoveCreData(uint32 guid, uint32 map, Position pos);
+ bool MoveCreData(uint32 guid, uint32 map, const Position& pos);
// reserved names
void LoadReservedPlayersNames();
@@ -1145,7 +1145,7 @@ class ObjectMgr
static PetNameInvalidReason CheckPetName(std::string const& name);
static bool IsValidCharterName(std::string const& name);
- static bool CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& names);
+ static bool CheckDeclinedNames(const std::wstring& w_ownname, DeclinedName const& names);
GameTele const* GetGameTele(uint32 id) const
{
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index ef8e3712af8..af8e7255603 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -1679,7 +1679,7 @@ void Guild::HandleSetMemberNote(WorldSession* session, std::string const& note,
}
}
-void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec rightsAndSlots)
+void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, const GuildBankRightsAndSlotsVec& rightsAndSlots)
{
// Only leader can modify ranks
if (!_IsLeader(session->GetPlayer()))
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index 9bf52cb08f2..9f6503fcf21 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -778,7 +778,7 @@ public:
void HandleSetNewGuildMaster(WorldSession* session, std::string const& name);
void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string const& name, std::string const& icon);
void HandleSetMemberNote(WorldSession* session, std::string const& note, uint64 guid, bool isPublic);
- void HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec rightsAndSlots);
+ void HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec const& rightsAndSlots);
void HandleBuyBankTab(WorldSession* session, uint8 tabId);
void HandleInviteMember(WorldSession* session, std::string const& name);
void HandleAcceptMember(WorldSession* session);
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 75655dca170..037127d160e 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -1253,7 +1253,7 @@ void LootTemplate::AddEntry(LootStoreItem* item)
Entries.push_back(item);
}
-void LootTemplate::CopyConditions(ConditionList conditions)
+void LootTemplate::CopyConditions(const ConditionList& conditions)
{
for (LootStoreItemList::iterator i = Entries.begin(); i != Entries.end(); ++i)
(*i)->conditions.clear();
diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
index d338f6f503b..c2f74aab701 100644
--- a/src/server/game/Loot/LootMgr.h
+++ b/src/server/game/Loot/LootMgr.h
@@ -228,7 +228,7 @@ class LootTemplate
void AddEntry(LootStoreItem* item);
// Rolls for every item in the template and adds the rolled items the the loot
void Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId = 0) const;
- void CopyConditions(ConditionList conditions);
+ void CopyConditions(const ConditionList& conditions);
void CopyConditions(LootItem* li) const;
// True if template includes at least 1 quest drop entry
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 65d9ee4f5ba..1fd762e7446 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -2412,6 +2412,8 @@ bool InstanceMap::AddPlayerToMap(Player* player)
mapSave = sInstanceSaveMgr->AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
}
+ ASSERT(mapSave);
+
// check for existing instance binds
InstancePlayerBind* playerBind = player->GetBoundInstance(GetId(), Difficulty(GetSpawnMode()));
if (playerBind && playerBind->perm)
@@ -2446,10 +2448,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
if (groupBind->save != mapSave)
{
TC_LOG_ERROR(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
- if (mapSave)
- TC_LOG_ERROR(LOG_FILTER_MAPS, "MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
- else
- TC_LOG_ERROR(LOG_FILTER_MAPS, "MapSave NULL");
+ TC_LOG_ERROR(LOG_FILTER_MAPS, "MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
if (groupBind->save)
TC_LOG_ERROR(LOG_FILTER_MAPS, "GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
else
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 94128262388..ecedfe07305 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -2283,14 +2283,15 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode,
// Handle damage modification, shapeshifted druids are not affected
if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm())
{
- if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
+ Player* player = target->ToPlayer();
+ if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
{
uint8 attacktype = Player::GetAttackBySlot(slot);
if (attacktype < MAX_ATTACK)
{
- target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), NULL, !apply);
- target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply);
+ player->_ApplyWeaponDamage(slot, item->GetTemplate(), NULL, !apply);
+ player->_ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), !apply);
}
}
}
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index db7e8b35f2f..df819de37c8 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -997,29 +997,6 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
if (!unitTarget || unitTarget->IsInFlight())
return;
- // Pre effects
- switch (m_spellInfo->Id)
- {
- case 66550: // teleports outside (Isle of Conquest)
- if (Player* target = unitTarget->ToPlayer())
- {
- if (target->GetTeamId() == TEAM_ALLIANCE)
- m_targets.SetDst(442.24f, -835.25f, 44.30f, 0.06f, 628);
- else
- m_targets.SetDst(1120.43f, -762.11f, 47.92f, 2.94f, 628);
- }
- break;
- case 66551: // teleports inside (Isle of Conquest)
- if (Player* target = unitTarget->ToPlayer())
- {
- if (target->GetTeamId() == TEAM_ALLIANCE)
- m_targets.SetDst(389.57f, -832.38f, 48.65f, 3.00f, 628);
- else
- m_targets.SetDst(1174.85f, -763.24f, 48.72f, 6.26f, 628);
- }
- break;
- }
-
// If not exist data for dest location - return
if (!m_targets.HasDst())
{
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 721a171917e..4bc390bd27e 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3049,8 +3049,9 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
break;
case 72293: // Mark of the Fallen Champion (Deathbringer Saurfang)
spellInfo->AttributesCu |= SPELL_ATTR0_CU_NEGATIVE_EFF0;
- break;
+ break;
case 38729: // Rod of Purification
+ case 51858: // Siphon of Acherus
case 96946: // Gaze of Occu'thar
case 101005: // Gaze of Occu'thar
spellInfo->AttributesCu |= SPELL_ATTR0_CU_TRIGGERED_BY_CASTER;
@@ -3762,6 +3763,13 @@ void SpellMgr::LoadSpellInfoCorrections()
case 101009: // Gaze of Occu'thar
spellInfo->AttributesEx &= ~SPELL_ATTR1_CHANNELED_1;
break;
+ // ISLE OF CONQUEST SPELLS
+ //
+ case 66551: // Teleport
+ spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
+ break;
+ // ENDOF ISLE OF CONQUEST SPELLS
+ //
default:
break;
}