refactor(Core): code cleanup (part 2) (#6374)
This commit is contained in:
parent
8f7ad83010
commit
466cdb68d6
80 changed files with 198 additions and 209 deletions
|
|
@ -1132,15 +1132,21 @@ namespace lfg
|
|||
}
|
||||
|
||||
if (!deletedGroupsToErase.empty())
|
||||
for (ObjectGuid const guid : deletedGroupsToErase)
|
||||
deletedGroups.erase(guid);
|
||||
{
|
||||
for (ObjectGuid const toErase : deletedGroupsToErase)
|
||||
{
|
||||
deletedGroups.erase(toErase);
|
||||
}
|
||||
}
|
||||
|
||||
if (!deletedGroups.empty())
|
||||
for (ObjectGuid const guid : deletedGroups)
|
||||
{
|
||||
for (ObjectGuid const deletedGroup : deletedGroups)
|
||||
{
|
||||
++deletedCounter;
|
||||
buffer_deleted << guid;
|
||||
buffer_deleted << deletedGroup;
|
||||
}
|
||||
}
|
||||
|
||||
WorldPacket differencePacket(SMSG_UPDATE_LFG_LIST, 1000);
|
||||
RBPacketBuildDifference(differencePacket, dungeonId, deletedCounter, buffer_deleted, groupCounter, buffer_groups, playerCounter, buffer_players);
|
||||
|
|
@ -2419,14 +2425,14 @@ namespace lfg
|
|||
LfgState state = GetState(guid);
|
||||
// If group is being formed after proposal success do nothing more
|
||||
LfgGuidSet const& players = it->second.GetPlayers();
|
||||
for (LfgGuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
for (auto iterator = players.begin(); iterator != players.end(); ++iterator)
|
||||
{
|
||||
ObjectGuid guid = (*it);
|
||||
SetGroup(*it, ObjectGuid::Empty);
|
||||
ObjectGuid objectGuid = (*iterator);
|
||||
SetGroup(*iterator, ObjectGuid::Empty);
|
||||
if (state != LFG_STATE_PROPOSAL)
|
||||
{
|
||||
SetState(*it, LFG_STATE_NONE);
|
||||
SendLfgUpdateParty(guid, LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE));
|
||||
SetState(*iterator, LFG_STATE_NONE);
|
||||
SendLfgUpdateParty(objectGuid, LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE));
|
||||
}
|
||||
}
|
||||
GroupsStore.erase(it);
|
||||
|
|
|
|||
|
|
@ -15,10 +15,7 @@
|
|||
*/
|
||||
|
||||
#include "Containers.h"
|
||||
#include "DBCStores.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "LFGQueue.h"
|
||||
#include "Log.h"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
* Interaction between core and LFGScripts
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Group.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "LFGScripts.h"
|
||||
|
|
@ -16,7 +15,6 @@
|
|||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
namespace lfg
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include "Common.h"
|
||||
#include "Corpse.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GossipDef.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -14,23 +14,18 @@
|
|||
#include "DatabaseEnv.h"
|
||||
#include "Formulas.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "LootMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Player.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "QuestDef.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
|
|
@ -42,6 +37,11 @@
|
|||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
// TODO: this import is not necessary for compilation and marked as unused by the IDE
|
||||
// however, for some reasons removing it would cause a damn linking issue
|
||||
// there is probably some underlying problem with imports which should properly addressed
|
||||
#include "GridNotifiersImpl.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
|
@ -553,7 +553,7 @@ void Creature::Update(uint32 diff)
|
|||
time_t now = time(nullptr);
|
||||
if (m_respawnTime <= now)
|
||||
{
|
||||
bool allowed = IsAIEnabled ? AI()->CanRespawn() : true; // First check if there are any scripts that object to us respawning
|
||||
bool allowed = !IsAIEnabled || AI()->CanRespawn(); // First check if there are any scripts that object to us respawning
|
||||
if (!allowed) // Will be rechecked on next Update call
|
||||
break;
|
||||
|
||||
|
|
@ -1899,7 +1899,7 @@ void Creature::InitializeReactState()
|
|||
else
|
||||
SetReactState(REACT_AGGRESSIVE);
|
||||
/*else if (IsCivilian())
|
||||
SetReactState(REACT_DEFENSIVE);*/;
|
||||
SetReactState(REACT_DEFENSIVE);*/
|
||||
}
|
||||
|
||||
bool Creature::HasMechanicTemplateImmunity(uint32 mask) const
|
||||
|
|
@ -3154,7 +3154,7 @@ bool Creature::IsMovementPreventedByCasting() const
|
|||
{
|
||||
Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL];
|
||||
// first check if currently a movement allowed channel is active and we're not casting
|
||||
if (!!spell && spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive() && spell->GetSpellInfo()->IsMoveAllowedChannel())
|
||||
if (spell && spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive() && spell->GetSpellInfo()->IsMoveAllowedChannel())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@
|
|||
#include "QuestDef.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Formulas.h"
|
||||
#include "Player.h"
|
||||
|
||||
GossipMenu::GossipMenu()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include "CreatureAI.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
|
@ -282,11 +281,11 @@ void Minion::InitStats(uint32 duration)
|
|||
|
||||
SetReactState(REACT_PASSIVE);
|
||||
|
||||
Unit* m_owner = GetOwner();
|
||||
SetCreatorGUID(m_owner->GetGUID());
|
||||
setFaction(m_owner->getFaction());
|
||||
Unit* owner = GetOwner();
|
||||
SetCreatorGUID(owner->GetGUID());
|
||||
setFaction(owner->getFaction());
|
||||
|
||||
m_owner->SetMinion(this, true);
|
||||
owner->SetMinion(this, true);
|
||||
}
|
||||
|
||||
void Minion::RemoveFromWorld()
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "CellImpl.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "ObjectAccessor.h"
|
||||
|
|
|
|||
|
|
@ -292,10 +292,10 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
|
|||
|
||||
SetObjectScale(goinfo->size);
|
||||
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
if (GameObjectTemplateAddon const* templateAddon = GetTemplateAddon())
|
||||
{
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, addon->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, templateAddon->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, templateAddon->flags);
|
||||
}
|
||||
|
||||
SetEntry(goinfo->entry);
|
||||
|
|
@ -2432,12 +2432,13 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
|||
}
|
||||
else if (index == GAMEOBJECT_FLAGS)
|
||||
{
|
||||
uint32 flags = m_uint32Values[GAMEOBJECT_FLAGS];
|
||||
if (GetGoType() == GAMEOBJECT_TYPE_CHEST)
|
||||
if (GetGOInfo()->chest.groupLootRules && !IsLootAllowedFor(target))
|
||||
flags |= GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE;
|
||||
uint32 goFlags = m_uint32Values[GAMEOBJECT_FLAGS];
|
||||
if (GetGoType() == GAMEOBJECT_TYPE_CHEST && GetGOInfo() && GetGOInfo()->chest.groupLootRules && !IsLootAllowedFor(target))
|
||||
{
|
||||
goFlags |= GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE;
|
||||
}
|
||||
|
||||
fieldBuffer << flags;
|
||||
fieldBuffer << goFlags;
|
||||
}
|
||||
else
|
||||
fieldBuffer << m_uint32Values[index]; // other cases
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
#include "Bag.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
void AddItemsSetItem(Player* player, Item* item)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
#include "ObjectMgr.h"
|
||||
#include "Util.h"
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@
|
|||
#include "DynamicTree.h"
|
||||
#include "DynamicVisibility.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MovementPacketBuilder.h"
|
||||
|
|
@ -37,11 +35,14 @@
|
|||
#include "UpdateMask.h"
|
||||
#include "Util.h"
|
||||
#include "Vehicle.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
// TODO: this import is not necessary for compilation and marked as unused by the IDE
|
||||
// however, for some reasons removing it would cause a damn linking issue
|
||||
// there is probably some underlying problem with imports which should properly addressed
|
||||
#include "GridNotifiersImpl.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "ElunaEventMgr.h"
|
||||
#include "LuaEngine.h"
|
||||
|
|
@ -2740,7 +2741,7 @@ Position WorldObject::GetFirstCollisionPosition(float startX, float startY, floa
|
|||
|
||||
MovePositionToFirstCollision(pos, distance, ang);
|
||||
return pos;
|
||||
};
|
||||
}
|
||||
|
||||
Position WorldObject::GetFirstCollisionPosition(float destX, float destY, float destZ)
|
||||
{
|
||||
|
|
@ -2755,7 +2756,7 @@ Position WorldObject::GetFirstCollisionPosition(float destX, float destY, float
|
|||
|
||||
MovePositionToFirstCollision(pos, distance, ang);
|
||||
return pos;
|
||||
};
|
||||
}
|
||||
|
||||
Position WorldObject::GetFirstCollisionPosition(float dist, float angle)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ struct MovementInfo
|
|||
void AddExtraMovementFlag(uint16 flag) { flags2 |= flag; }
|
||||
[[nodiscard]] bool HasExtraMovementFlag(uint16 flag) const { return flags2 & flag; }
|
||||
|
||||
void SetFallTime(uint32 time) { fallTime = time; }
|
||||
void SetFallTime(uint32 newFallTime) { fallTime = newFallTime; }
|
||||
|
||||
void OutDebug();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "UpdateData.h"
|
||||
#include "ByteBuffer.h"
|
||||
#include "Common.h"
|
||||
#include "Errors.h"
|
||||
#include "Log.h"
|
||||
#include "Opcodes.h"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include "Common.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Formulas.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
|
|
@ -192,8 +191,10 @@ bool Pet::LoadPetFromDB(Player* owner, uint8 asynchLoadType, uint32 petentry, ui
|
|||
stmt->setUInt8(2, uint8(PET_SAVE_LAST_STABLE_SLOT));
|
||||
}
|
||||
|
||||
if (AsynchPetSummon* info = owner->GetSession()->_loadPetFromDBFirstCallback.GetSecondParam())
|
||||
delete info;
|
||||
if (AsynchPetSummon* infoToDelete = owner->GetSession()->_loadPetFromDBFirstCallback.GetSecondParam())
|
||||
{
|
||||
delete infoToDelete;
|
||||
}
|
||||
|
||||
owner->GetSession()->_loadPetFromDBFirstCallback.Reset();
|
||||
owner->GetSession()->_loadPetFromDBFirstCallback.SetFirstParam(asynchLoadType);
|
||||
|
|
@ -1402,24 +1403,24 @@ void Pet::_SaveAuras(SQLTransaction& trans, bool logout)
|
|||
|
||||
uint8 index = 0;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_AURA);
|
||||
stmt->setUInt32(index++, m_charmInfo->GetPetNumber());
|
||||
stmt->setUInt64(index++, casterGUID.GetRawValue());
|
||||
stmt->setUInt32(index++, itr->second->GetId());
|
||||
stmt->setUInt8(index++, effMask);
|
||||
stmt->setUInt8(index++, recalculateMask);
|
||||
stmt->setUInt8(index++, itr->second->GetStackAmount());
|
||||
stmt->setInt32(index++, damage[0]);
|
||||
stmt->setInt32(index++, damage[1]);
|
||||
stmt->setInt32(index++, damage[2]);
|
||||
stmt->setInt32(index++, baseDamage[0]);
|
||||
stmt->setInt32(index++, baseDamage[1]);
|
||||
stmt->setInt32(index++, baseDamage[2]);
|
||||
stmt->setInt32(index++, itr->second->GetMaxDuration());
|
||||
stmt->setInt32(index++, itr->second->GetDuration());
|
||||
stmt->setUInt8(index++, itr->second->GetCharges());
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_AURA);
|
||||
stmt2->setUInt32(index++, m_charmInfo->GetPetNumber());
|
||||
stmt2->setUInt64(index++, casterGUID.GetRawValue());
|
||||
stmt2->setUInt32(index++, itr->second->GetId());
|
||||
stmt2->setUInt8(index++, effMask);
|
||||
stmt2->setUInt8(index++, recalculateMask);
|
||||
stmt2->setUInt8(index++, itr->second->GetStackAmount());
|
||||
stmt2->setInt32(index++, damage[0]);
|
||||
stmt2->setInt32(index++, damage[1]);
|
||||
stmt2->setInt32(index++, damage[2]);
|
||||
stmt2->setInt32(index++, baseDamage[0]);
|
||||
stmt2->setInt32(index++, baseDamage[1]);
|
||||
stmt2->setInt32(index++, baseDamage[2]);
|
||||
stmt2->setInt32(index++, itr->second->GetMaxDuration());
|
||||
stmt2->setInt32(index++, itr->second->GetDuration());
|
||||
stmt2->setUInt8(index++, itr->second->GetCharges());
|
||||
|
||||
trans->Append(stmt);
|
||||
trans->Append(stmt2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4229,8 +4229,10 @@ void Player::removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporar
|
|||
if (GetTalentSpellCost(firstRankSpellId))
|
||||
{
|
||||
SpellsRequiringSpellMapBounds spellsRequiringSpell = sSpellMgr->GetSpellsRequiringSpellBounds(spellId);
|
||||
for (SpellsRequiringSpellMap::const_iterator itr = spellsRequiringSpell.first; itr != spellsRequiringSpell.second; ++itr)
|
||||
removeSpell(itr->second, removeSpecMask, onlyTemporary);
|
||||
for (auto spellsItr = spellsRequiringSpell.first; spellsItr != spellsRequiringSpell.second; ++spellsItr)
|
||||
{
|
||||
removeSpell(spellsItr->second, removeSpecMask, onlyTemporary);
|
||||
}
|
||||
}
|
||||
|
||||
// pussywizard: re-search, it can be corrupted in prev loop
|
||||
|
|
@ -7732,12 +7734,14 @@ uint32 Player::GetZoneIdFromDB(ObjectGuid guid)
|
|||
// stored zone is zero, use generic and slow zone detection
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION_XYZ);
|
||||
stmt->setUInt32(0, guidLow);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
PreparedQueryResult posResult = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
if (!posResult)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
fields = result->Fetch();
|
||||
fields = posResult->Fetch();
|
||||
uint32 map = fields[0].GetUInt16();
|
||||
float posx = fields[1].GetFloat();
|
||||
float posy = fields[2].GetFloat();
|
||||
|
|
@ -19073,9 +19077,11 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
|
|||
}
|
||||
else if (invalidBagMap.find(bagGuid) != invalidBagMap.end())
|
||||
{
|
||||
std::map<ObjectGuid::LowType, Item*>::iterator itr = invalidBagMap.find(bagGuid);
|
||||
if (std::find(problematicItems.begin(), problematicItems.end(), itr->second) != problematicItems.end())
|
||||
std::map<ObjectGuid::LowType, Item*>::iterator iterator = invalidBagMap.find(bagGuid);
|
||||
if (std::find(problematicItems.begin(), problematicItems.end(), iterator->second) != problematicItems.end())
|
||||
{
|
||||
err = EQUIP_ERR_INT_BAG_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
#include "Group.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
#include "WorldModel.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
MotionTransport::MotionTransport() : Transport(), _transportInfo(nullptr), _isMoving(true), _pendingStop(false), _triggeredArrivalEvent(false), _triggeredDepartureEvent(false), _passengersLoaded(false), _delayedTeleport(false)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include "ScriptMgr.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -960,8 +960,8 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
|||
// Rage from damage received
|
||||
if (attacker != victim && victim->getPowerType() == POWER_RAGE)
|
||||
{
|
||||
uint32 rage_damage = damage + (cleanDamage ? cleanDamage->absorbed_damage : 0);
|
||||
victim->RewardRage(rage_damage, 0, false);
|
||||
uint32 rageDamage = damage + (cleanDamage ? cleanDamage->absorbed_damage : 0);
|
||||
victim->RewardRage(rageDamage, 0, false);
|
||||
}
|
||||
|
||||
if (attacker && attacker->GetTypeId() == TYPEID_PLAYER)
|
||||
|
|
@ -2209,7 +2209,7 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
|
|||
return;
|
||||
|
||||
// CombatStart puts the target into stand state, so we need to cache sit state here to know if we should crit later
|
||||
const bool sittingVictim = victim->GetTypeId() == TYPEID_PLAYER && (victim->IsSitState() || victim->getStandState() == UNIT_STAND_STATE_SLEEP) ? true : false;
|
||||
const bool sittingVictim = victim->GetTypeId() == TYPEID_PLAYER && (victim->IsSitState() || victim->getStandState() == UNIT_STAND_STATE_SLEEP);
|
||||
|
||||
CombatStart(victim);
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MELEE_ATTACK);
|
||||
|
|
@ -11272,8 +11272,8 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
|
|||
{
|
||||
int32 modifierMax = 0;
|
||||
int32 modifierMin = 0;
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
AuraEffectList const& auraEffectList = GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT);
|
||||
for (AuraEffectList::const_iterator i = auraEffectList.begin(); i != auraEffectList.end(); ++i)
|
||||
{
|
||||
if (!spellProto->ValidateAttribute6SpellDamageMods(caster, *i, damagetype == DOT))
|
||||
continue;
|
||||
|
|
@ -18099,9 +18099,9 @@ void Unit::GetPartyMembers(std::list<Unit*>& TagUnitMap)
|
|||
if (Target->IsAlive())
|
||||
TagUnitMap.push_back(Target);
|
||||
|
||||
for (Unit::ControlSet::iterator itr = Target->m_Controlled.begin(); itr != Target->m_Controlled.end(); ++itr)
|
||||
for (Unit::ControlSet::iterator iterator = Target->m_Controlled.begin(); iterator != Target->m_Controlled.end(); ++iterator)
|
||||
{
|
||||
if (Unit* pet = *itr)
|
||||
if (Unit* pet = *iterator)
|
||||
if (pet->IsGuardian() && pet->IsAlive())
|
||||
TagUnitMap.push_back(pet);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2177,7 +2177,7 @@ public:
|
|||
bool isInBackInMap(Unit const* target, float distance, float arc = M_PI) const;
|
||||
|
||||
// Visibility system
|
||||
[[nodiscard]] bool IsVisible() const { return (m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GM) > SEC_PLAYER) ? false : true; }
|
||||
[[nodiscard]] bool IsVisible() const { return m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GM) <= SEC_PLAYER; }
|
||||
void SetVisible(bool x);
|
||||
void SetModelVisible(bool on);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,13 +13,11 @@
|
|||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Unit.h"
|
||||
#include "Util.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "ZoneScript.h"
|
||||
|
||||
Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) :
|
||||
_me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry), _status(STATUS_NONE)
|
||||
|
|
|
|||
|
|
@ -4,14 +4,12 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "CellImpl.h"
|
||||
#include "Corpse.h"
|
||||
#include "Creature.h"
|
||||
#include "DynamicObject.h"
|
||||
#include "GameObject.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Item.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MapInstanced.h"
|
||||
|
|
@ -24,9 +22,7 @@
|
|||
#include "Player.h"
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include <cmath>
|
||||
|
||||
template<class T>
|
||||
void HashMapHolder<T>::Insert(T* o)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -95,6 +95,6 @@ namespace ObjectAccessor
|
|||
|
||||
template<>
|
||||
void RemoveObject(Player* player);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "AccountMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "ArenaTeam.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
|
|
@ -16,7 +15,6 @@
|
|||
#include "GossipDef.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "Language.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
|
|
|
|||
|
|
@ -4,17 +4,14 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Item.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "Transport.h"
|
||||
#include "UpdateData.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
using namespace Acore;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
#include "ObjectMgr.h"
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
|
||||
// for loading world object at grid loading (Corpses)
|
||||
//TODO: to implement npc on transport, also need to load npcs at grid loading
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
|
|
@ -460,26 +459,28 @@ bool Group::AddMember(Player* player)
|
|||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
if (itr->GetSource() == player) // pussywizard: no check same map, adding members is single threaded
|
||||
continue;
|
||||
|
||||
if (Player* member = itr->GetSource())
|
||||
{
|
||||
if (player->HaveAtClient(member))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Player* itrMember = itr->GetSource())
|
||||
{
|
||||
if (player->HaveAtClient(itrMember))
|
||||
{
|
||||
member->SetFieldNotifyFlag(UF_FLAG_PARTY_MEMBER);
|
||||
member->BuildValuesUpdateBlockForPlayer(&groupData, player);
|
||||
member->RemoveFieldNotifyFlag(UF_FLAG_PARTY_MEMBER);
|
||||
itrMember->SetFieldNotifyFlag(UF_FLAG_PARTY_MEMBER);
|
||||
itrMember->BuildValuesUpdateBlockForPlayer(&groupData, player);
|
||||
itrMember->RemoveFieldNotifyFlag(UF_FLAG_PARTY_MEMBER);
|
||||
}
|
||||
|
||||
if (member->HaveAtClient(player))
|
||||
if (itrMember->HaveAtClient(player))
|
||||
{
|
||||
UpdateData newData;
|
||||
WorldPacket newDataPacket;
|
||||
player->BuildValuesUpdateBlockForPlayer(&newData, member);
|
||||
player->BuildValuesUpdateBlockForPlayer(&newData, itrMember);
|
||||
if (newData.HasData())
|
||||
{
|
||||
newData.BuildPacket(&newDataPacket);
|
||||
member->SendDirectMessage(&newDataPacket);
|
||||
itrMember->SendDirectMessage(&newDataPacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "AccountMgr.h"
|
||||
#include "CalendarMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Config.h"
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@
|
|||
#include "ArenaTeam.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "AccountMgr.h"
|
||||
#include "AsyncAuctionListing.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
#include "Chat.h"
|
||||
|
|
|
|||
|
|
@ -9,14 +9,10 @@
|
|||
#include "Battleground.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Group.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
#include "AccountMgr.h"
|
||||
#include "ArenaTeam.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
#include "Battleground.h"
|
||||
|
|
@ -18,7 +17,6 @@
|
|||
#include "Guild.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "Language.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include "ChannelMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "Guild.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
|
|
@ -12,7 +11,6 @@
|
|||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "Vehicle.h"
|
||||
#include "VehicleDefines.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Log.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateData.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Guild.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "Log.h"
|
||||
|
|
|
|||
|
|
@ -4,12 +4,10 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Corpse.h"
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "Group.h"
|
||||
#include "Log.h"
|
||||
#include "LootItemStorage.h"
|
||||
#include "LootMgr.h"
|
||||
#include "Object.h"
|
||||
|
|
@ -17,7 +15,6 @@
|
|||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
#include "BattlefieldMgr.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "BigNumber.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
#include "CreatureAI.h"
|
||||
|
|
@ -36,7 +34,6 @@
|
|||
#include "Spell.h"
|
||||
#include "UpdateData.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WhoListCache.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
|
@ -461,12 +458,14 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recv_data*/)
|
|||
if (GetPlayer()->CanFreeMove())
|
||||
{
|
||||
if (GetPlayer()->getStandState() == UNIT_STAND_STATE_STAND)
|
||||
{
|
||||
GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_FORCE_MOVE_ROOT, (8 + 4)); // guess size
|
||||
data << GetPlayer()->GetPackGUID();
|
||||
data << (uint32)2;
|
||||
SendPacket(&data);
|
||||
WorldPacket data2(SMSG_FORCE_MOVE_ROOT, (8 + 4)); // guess size
|
||||
data2 << GetPlayer()->GetPackGUID();
|
||||
data2 << (uint32)2;
|
||||
SendPacket(&data2);
|
||||
GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,9 @@
|
|||
#include "BattlegroundMgr.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
#include "Corpse.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "MathUtil.h"
|
||||
#include "MapManager.h"
|
||||
|
|
@ -69,7 +67,7 @@ void WorldSession::HandleMoveWorldportAck()
|
|||
}
|
||||
|
||||
// reset instance validity, except if going to an instance inside an instance
|
||||
if (GetPlayer()->m_InstanceValid == false && !mInstance)
|
||||
if (!GetPlayer()->m_InstanceValid && !mInstance)
|
||||
{
|
||||
GetPlayer()->m_InstanceValid = true;
|
||||
// pussywizard: m_InstanceValid can be false only by leaving a group in an instance => so remove temp binds that could not be removed because player was still on the map!
|
||||
|
|
|
|||
|
|
@ -6,14 +6,10 @@
|
|||
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Common.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
|
|
|
|||
|
|
@ -849,7 +849,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint16 spe
|
|||
}
|
||||
else if (haspositiveeffect)
|
||||
{
|
||||
bool tempspellIsPositive = true;
|
||||
bool tmpSpellIsPositive = true;
|
||||
pet->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||
// This is true if pet has no target or has target but targets differs.
|
||||
Unit* victim = pet->GetVictim();
|
||||
|
|
@ -880,7 +880,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint16 spe
|
|||
pet->SendPetAIReaction(guid1);
|
||||
}
|
||||
|
||||
pet->ToPet()->CastWhenWillAvailable(spellid, unit_target, victim, tempspellIsPositive);
|
||||
pet->ToPet()->CastWhenWillAvailable(spellid, unit_target, victim, tmpSpellIsPositive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1103,21 +1103,37 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
|
|||
if (act_state == ACT_ENABLED)
|
||||
{
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->IsPet())
|
||||
{
|
||||
((Pet*)pet)->ToggleAutocast(spellInfo, true);
|
||||
}
|
||||
else
|
||||
for (Unit::ControlSet::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
|
||||
if ((*itr)->GetEntry() == pet->GetEntry())
|
||||
(*itr)->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, true);
|
||||
{
|
||||
for (auto iterator = GetPlayer()->m_Controlled.begin(); iterator != GetPlayer()->m_Controlled.end(); ++iterator)
|
||||
{
|
||||
if ((*iterator)->GetEntry() == pet->GetEntry())
|
||||
{
|
||||
(*iterator)->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//sign for no/turn off autocast
|
||||
else if (act_state == ACT_DISABLED)
|
||||
{
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->IsPet())
|
||||
{
|
||||
((Pet*)pet)->ToggleAutocast(spellInfo, false);
|
||||
}
|
||||
else
|
||||
for (Unit::ControlSet::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
|
||||
if ((*itr)->GetEntry() == pet->GetEntry())
|
||||
(*itr)->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, false);
|
||||
{
|
||||
for (auto iterator = GetPlayer()->m_Controlled.begin(); iterator != GetPlayer()->m_Controlled.end(); ++iterator)
|
||||
{
|
||||
if ((*iterator)->GetEntry() == pet->GetEntry())
|
||||
{
|
||||
(*iterator)->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "ArenaTeam.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "Common.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Guild.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "Language.h"
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "NPCHandler.h"
|
||||
|
|
@ -14,7 +12,6 @@
|
|||
#include "Opcodes.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@
|
|||
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundAV.h"
|
||||
#include "Common.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Group.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -4,14 +4,10 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "Log.h"
|
||||
|
|
@ -15,7 +13,6 @@
|
|||
#include "ScriptMgr.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "TicketMgr.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "AccountMgr.h"
|
||||
#include "Common.h"
|
||||
#include "Item.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Log.h"
|
||||
#include "Opcodes.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "CellImpl.h"
|
||||
#include "Common.h"
|
||||
#include "Config.h"
|
||||
#include "GridNotifiers.h"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "Spell.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
void InstanceScript::SaveToDB()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Xinef
|
|||
#include "LootItemStorage.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PreparedStatement.h"
|
||||
#include <time.h>
|
||||
|
||||
LootItemStorage::LootItemStorage()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2986,7 +2986,7 @@ void InstanceMap::UnloadAll()
|
|||
{
|
||||
ASSERT(!HavePlayers());
|
||||
|
||||
if (m_resetAfterUnload == true)
|
||||
if (m_resetAfterUnload)
|
||||
{
|
||||
DeleteRespawnTimes();
|
||||
DeleteCorpseData();
|
||||
|
|
@ -3331,9 +3331,9 @@ void Map::LogEncounterFinished(EncounterCreditType type, uint32 creditEntry)
|
|||
{
|
||||
std::string auraStr;
|
||||
const Unit::AuraApplicationMap& a = p->GetAppliedAuras();
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = a.begin(); itr != a.end(); ++itr)
|
||||
for (auto iterator = a.begin(); iterator != a.end(); ++iterator)
|
||||
{
|
||||
snprintf(buffer2, 255, "%u(%u) ", itr->first, itr->second->GetEffectMask());
|
||||
snprintf(buffer2, 255, "%u(%u) ", iterator->first, iterator->second->GetEffectMask());
|
||||
auraStr += buffer2;
|
||||
}
|
||||
|
||||
|
|
@ -3777,7 +3777,7 @@ bool Map::CheckCollisionAndGetValidCoords(const WorldObject* source, float start
|
|||
}
|
||||
}
|
||||
|
||||
return failOnCollision ? !collided : true;
|
||||
return !failOnCollision || !collided;
|
||||
}
|
||||
|
||||
void Map::LoadCorpseData()
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "World.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
|
|
|
|||
|
|
@ -5,10 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "AvgDiffTracker.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "Config.h"
|
||||
#include "Corpse.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GridDefines.h"
|
||||
#include "Group.h"
|
||||
|
|
@ -27,7 +24,6 @@
|
|||
#include "Transport.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
|
|
@ -319,9 +315,13 @@ bool MapManager::IsValidMAP(uint32 mapid, bool startUp)
|
|||
MapEntry const* mEntry = sMapStore.LookupEntry(mapid);
|
||||
|
||||
if (startUp)
|
||||
return !!mEntry;
|
||||
{
|
||||
return mEntry != nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mEntry && (!mEntry->IsDungeon() || sObjectMgr->GetInstanceTemplate(mapid));
|
||||
}
|
||||
|
||||
// TODO: add check for battleground template
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "AsyncAuctionListing.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
#include "Creature.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#ifndef __ASYNCAUCTIONLISTING_H
|
||||
#define __ASYNCAUCTIONLISTING_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "AvgDiffTracker.h"
|
||||
|
||||
AvgDiffTracker avgDiffTracker;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#ifndef __AVGDIFFTRACKER_H
|
||||
#define __AVGDIFFTRACKER_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "DynamicVisibility.h"
|
||||
|
||||
uint8 DynamicVisibilityMgr::visibilitySettingsIndex = 0;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#ifndef __DYNAMICVISIBILITY_H
|
||||
#define __DYNAMICVISIBILITY_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#ifndef _GAMEGRAVEYARD_H_
|
||||
#define _GAMEGRAVEYARD_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "SavingSystem.h"
|
||||
#include "World.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#ifndef __SAVINGSYSTEM_H
|
||||
#define __SAVINGSYSTEM_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "GuildMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#ifndef __WHOLISTCACHE_H
|
||||
#define __WHOLISTCACHE_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) MaNGOS, TrinityCore, AzerothCore
|
||||
*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
* Copyright (C) 2008-2019 TrinityCore <https://www.trinitycore.org>
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include "CreatureAI.h"
|
||||
#include "FleeingMovementGenerator.h"
|
||||
#include "MapManager.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "Creature.h"
|
||||
#include "DetourCommon.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Geometry.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
|
|
@ -1155,13 +1154,13 @@ bool PathGenerator::IsSwimmableSegment(float x, float y, float z, float destX, f
|
|||
(!checkSwim || !_sourceCreature || _sourceCreature->CanSwim());
|
||||
}
|
||||
|
||||
bool PathGenerator::IsWaterPath(Movement::PointsArray _pathPoints) const
|
||||
bool PathGenerator::IsWaterPath(Movement::PointsArray pathPoints) const
|
||||
{
|
||||
bool waterPath = true;
|
||||
// Check both start and end points, if they're both in water, then we can *safely* let the creature move
|
||||
for (uint32 i = 0; i < _pathPoints.size(); ++i)
|
||||
for (uint32 i = 0; i < pathPoints.size(); ++i)
|
||||
{
|
||||
NavTerrain terrain = GetNavTerrain(_pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z);
|
||||
NavTerrain terrain = GetNavTerrain(pathPoints[i].x, pathPoints[i].y, pathPoints[i].z);
|
||||
// One of the points is not in the water
|
||||
if (terrain != NAV_MAGMA && terrain != NAV_WATER)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class PathGenerator
|
|||
[[nodiscard]] bool IsWalkableClimb(float const* v1, float const* v2) const;
|
||||
[[nodiscard]] bool IsWalkableClimb(float x, float y, float z, float destX, float destY, float destZ) const;
|
||||
[[nodiscard]] static bool IsWalkableClimb(float x, float y, float z, float destX, float destY, float destZ, float sourceHeight);
|
||||
[[nodiscard]] bool IsWaterPath(Movement::PointsArray _pathPoints) const;
|
||||
[[nodiscard]] bool IsWaterPath(Movement::PointsArray pathPoints) const;
|
||||
[[nodiscard]] bool IsSwimmableSegment(float const* v1, float const* v2, bool checkSwim = true) const;
|
||||
[[nodiscard]] bool IsSwimmableSegment(float x, float y, float z, float destX, float destY, float destZ, bool checkSwim = true) const;
|
||||
[[nodiscard]] static float GetRequiredHeightToClimb(float x, float y, float z, float destX, float destY, float destZ, float sourceHeight);
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||
{
|
||||
owner->StopMoving();
|
||||
_lastTargetPosition.reset();
|
||||
if (Creature* cOwner = owner->ToCreature())
|
||||
if (Creature* cOwner2 = owner->ToCreature())
|
||||
{
|
||||
cOwner->SetCannotReachTarget(false);
|
||||
cOwner2->SetCannotReachTarget(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -82,9 +82,9 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||
{
|
||||
i_recalculateTravel = false;
|
||||
i_path = nullptr;
|
||||
if (Creature* cOwner = owner->ToCreature())
|
||||
if (Creature* cOwner2 = owner->ToCreature())
|
||||
{
|
||||
cOwner->SetCannotReachTarget(false);
|
||||
cOwner2->SetCannotReachTarget(false);
|
||||
}
|
||||
|
||||
owner->StopMoving();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include "DatabaseEnv.h"
|
||||
#include "GridDefines.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "WaypointManager.h"
|
||||
|
||||
WaypointMgr::WaypointMgr()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue