diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Creature/Creature.cpp | 5 | ||||
-rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.cpp | 2 | ||||
-rwxr-xr-x | src/server/game/Instances/InstanceScript.cpp | 16 | ||||
-rwxr-xr-x | src/server/game/Maps/Map.cpp | 6 | ||||
-rwxr-xr-x | src/server/game/Maps/Map.h | 8 | ||||
-rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 17 |
6 files changed, 28 insertions, 26 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 833fcd44554..f9930fd47c7 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -137,14 +137,13 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) return true; } -Creature::Creature(): Unit(), +Creature::Creature(): Unit(), MapCreature(), lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), lootingGroupLowGUID(0), m_PlayerDamageReq(0), m_lootMoney(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemoveTime(0), m_respawnTime(0), m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), -m_creatureInfo(NULL), m_creatureData(NULL), m_formation(NULL), -MapCreature() +m_creatureInfo(NULL), m_creatureData(NULL), m_formation(NULL) { m_regenTimer = CREATURE_REGEN_INTERVAL; m_valuesCount = UNIT_END; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index bac96a01222..c58cf9d59e0 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -602,10 +602,12 @@ void GameObject::Delete() { SetLootState(GO_NOT_READY); if (GetOwnerGUID()) + { if (Unit* owner = GetOwner()) owner->RemoveGameObject(this, false); else //! Owner not in world anymore SetOwnerGUID(0); + } ASSERT (!GetOwnerGUID()); SendObjectDeSpawnAnim(GetGUID()); diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index b9b9ed281fa..f0e21f7f709 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -141,34 +141,36 @@ void InstanceScript::AddDoor(GameObject* door, bool add) for (DoorInfoMap::iterator itr = lower; itr != upper; ++itr) { + DoorInfo const& data = itr->second; + if (add) { - itr->second.bossInfo->door[itr->second.type].insert(door); - switch (itr->second.boundary) + data.bossInfo->door[data.type].insert(door); + switch (data.boundary) { default: case BOUNDARY_NONE: break; case BOUNDARY_N: case BOUNDARY_S: - itr->second.bossInfo->boundary[itr->second.boundary] = door->GetPositionX(); + data.bossInfo->boundary[data.boundary] = door->GetPositionX(); break; case BOUNDARY_E: case BOUNDARY_W: - itr->second.bossInfo->boundary[itr->second.boundary] = door->GetPositionY(); + data.bossInfo->boundary[data.boundary] = door->GetPositionY(); break; case BOUNDARY_NW: case BOUNDARY_SE: - itr->second.bossInfo->boundary[itr->second.boundary] = door->GetPositionX() + door->GetPositionY(); + data.bossInfo->boundary[data.boundary] = door->GetPositionX() + door->GetPositionY(); break; case BOUNDARY_NE: case BOUNDARY_SW: - itr->second.bossInfo->boundary[itr->second.boundary] = door->GetPositionX() - door->GetPositionY(); + data.bossInfo->boundary[data.boundary] = door->GetPositionX() - door->GetPositionY(); break; } } else - itr->second.bossInfo->door[itr->second.type].erase(door); + data.bossInfo->door[data.type].erase(door); } if (add) diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index d40b826709e..8824f302f56 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -202,11 +202,11 @@ void Map::DeleteStateMachine() } Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode, Map* _parent): -i_mapEntry (sMapStore.LookupEntry(id)), i_spawnMode(SpawnMode), i_InstanceId(InstanceId), +_creatureToMoveLock(false), i_mapEntry (sMapStore.LookupEntry(id)), i_spawnMode(SpawnMode), i_InstanceId(InstanceId), m_unloadTimer(0), m_VisibleDistance(DEFAULT_VISIBILITY_DISTANCE), m_VisibilityNotifyPeriod(DEFAULT_VISIBILITY_NOTIFY_PERIOD), m_activeNonPlayersIter(m_activeNonPlayers.end()), i_gridExpiry(expiry), -i_scriptLock(false), _creatureToMoveLock(false) +i_scriptLock(false) { m_parentMap = (_parent ? _parent : this); for (unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx) @@ -436,7 +436,7 @@ bool Map::AddToMap(Player* player) } template<class T> -void Map::InitializeObject(T* obj) +void Map::InitializeObject(T* /*obj*/) { } diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index fd58fd0cc72..0fff299feff 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -420,8 +420,8 @@ class Map : public GridRefManager<NGridType> GameObject* GetGameObject(uint64 guid); DynamicObject* GetDynamicObject(uint64 guid); - MapInstanced* ToMainstanced(){ if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); else return NULL; } - const MapInstanced* ToMainstanced() const { if (Instanceable()) return (const MapInstanced*)((MapInstanced*)this); else return NULL; } + MapInstanced* ToMapInstanced(){ if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); else return NULL; } + const MapInstanced* ToMapInstanced() const { if (Instanceable()) return (const MapInstanced*)((MapInstanced*)this); else return NULL; } InstanceMap* ToInstanceMap(){ if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; } const InstanceMap* ToInstanceMap() const { if (IsDungeon()) return (const InstanceMap*)((InstanceMap*)this); else return NULL; } @@ -443,6 +443,7 @@ class Map : public GridRefManager<NGridType> template<class T> void InitializeObject(T* obj); void AddCreatureToMoveList(Creature* c, float x, float y, float z, float ang); void RemoveCreatureFromMoveList(Creature* c); + bool _creatureToMoveLock; std::vector<Creature*> _creaturesToMove; @@ -458,8 +459,7 @@ class Map : public GridRefManager<NGridType> NGridType* getNGrid(uint32 x, uint32 y) const { - ASSERT(x < MAX_NUMBER_OF_GRIDS); - ASSERT(y < MAX_NUMBER_OF_GRIDS); + ASSERT(x < MAX_NUMBER_OF_GRIDS && y < MAX_NUMBER_OF_GRIDS); return i_grids[x][y]; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 1688624be91..38f334058b8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1227,7 +1227,7 @@ class npc_tirion_fordring_tft : public CreatureScript SetEquipmentSlots(true); // remove glow on ashbringer } - void sGossipSelect(Player* player, uint32 sender, uint32 action) + void sGossipSelect(Player* /*player*/, uint32 sender, uint32 action) { if (me->GetCreatureInfo()->GossipMenuId == sender && !action) { @@ -1407,14 +1407,14 @@ class npc_raging_spirit : public CreatureScript DoCast(me, SPELL_BOSS_HITTIN_YA, true); } - void IsSummonedBy(Unit* summoner) + void IsSummonedBy(Unit* /*summoner*/) { // player is the spellcaster so register summon manually if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING))) lichKing->AI()->JustSummoned(me); } - void JustDied(Unit* killer) + void JustDied(Unit* /*killer*/) { if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING))) lichKing->AI()->SummonedCreatureDespawn(me); @@ -1931,7 +1931,7 @@ class npc_spirit_bomb : public CreatureScript { } - void IsSummonedBy(Unit* summoner) + void IsSummonedBy(Unit* /*summoner*/) { float destX, destY, destZ; me->GetPosition(destX, destY); @@ -1954,7 +1954,7 @@ class npc_spirit_bomb : public CreatureScript { } - void UpdateAI(uint32 const diff) + void UpdateAI(uint32 const /*diff*/) { UpdateVictim(); // no melee attacks @@ -1983,7 +1983,7 @@ class npc_broken_frostmourne : public CreatureScript _events.Reset(); } - void IsSummonedBy(Unit* summoner) + void IsSummonedBy(Unit* /*summoner*/) { _events.SetPhase(PHASE_OUTRO); _events.ScheduleEvent(EVENT_OUTRO_KNOCK_BACK, 3000, 0, PHASE_OUTRO); @@ -2087,7 +2087,6 @@ class spell_the_lich_king_necrotic_plague : public SpellScriptLoader void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* newCaster = GetTarget(); switch (GetTargetApplication()->GetRemoveMode()) { case AURA_REMOVE_BY_ENEMY_SPELL: @@ -2250,7 +2249,7 @@ class spell_the_lich_king_shadow_trap_visual : public SpellScriptLoader { PrepareAuraScript(spell_the_lich_king_shadow_trap_visual_AuraScript); - void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes mode) + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) GetTarget()->CastSpell(GetTarget(), SPELL_SHADOW_TRAP_AURA, TRIGGERED_NONE); @@ -2633,7 +2632,7 @@ class spell_the_lich_king_cast_back_to_caster : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_cast_back_to_caster_SpellScript); - void HandleScript(SpellEffIndex effIndex) + void HandleScript(SpellEffIndex /*effIndex*/) { GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true); } |