Revert "Build/Clang: fixed 96 warnings + improved code readability"

This reverts commit a4589f71d5.
This commit is contained in:
ShinDarth
2016-09-04 10:11:10 +02:00
parent e5fd1095c9
commit 5802a37698
28 changed files with 62 additions and 132 deletions
+2 -6
View File
@@ -205,12 +205,8 @@ namespace ArenaSpectator
if (effMask & (1<<i)) if (effMask & (1<<i))
{ {
AuraType at = aura->GetEffect(i)->GetAuraType(); AuraType at = aura->GetEffect(i)->GetAuraType();
if ((aura->GetEffect(i)->GetAmount() && (aura->GetSpellInfo()->IsPositive() || targetGUID != aura->GetCasterGUID())) || if (aura->GetEffect(i)->GetAmount() && (aura->GetSpellInfo()->IsPositive() || targetGUID != aura->GetCasterGUID()) ||
at == SPELL_AURA_MECHANIC_IMMUNITY || at == SPELL_AURA_MECHANIC_IMMUNITY || at == SPELL_AURA_EFFECT_IMMUNITY || at == SPELL_AURA_STATE_IMMUNITY || at == SPELL_AURA_SCHOOL_IMMUNITY || at == SPELL_AURA_DISPEL_IMMUNITY)
at == SPELL_AURA_EFFECT_IMMUNITY ||
at == SPELL_AURA_STATE_IMMUNITY ||
at == SPELL_AURA_SCHOOL_IMMUNITY ||
at == SPELL_AURA_DISPEL_IMMUNITY)
return true; return true;
} }
} }
+4 -4
View File
@@ -378,8 +378,8 @@ void BattlegroundQueue::FillPlayersToBG(const int32 aliFree, const int32 hordeFr
// quick check if nothing we can do: // quick check if nothing we can do:
if (!sBattlegroundMgr->isTesting()) if (!sBattlegroundMgr->isTesting())
if ((aliFree > hordeFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty()) || if (aliFree > hordeFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty() ||
(hordeFree > aliFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty())) hordeFree > aliFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty())
return; return;
// ally: at first fill as much as possible // ally: at first fill as much as possible
@@ -434,8 +434,8 @@ void BattlegroundQueue::FillPlayersToBGWithSpecific(const int32 aliFree, const i
// quick check if nothing we can do: // quick check if nothing we can do:
if (!sBattlegroundMgr->isTesting()) if (!sBattlegroundMgr->isTesting())
if ((m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty()) || if (m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty() ||
(m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_HORDE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_HORDE].empty())) m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_HORDE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_HORDE].empty())
return; return;
// copy groups from both queues to new joined container // copy groups from both queues to new joined container
@@ -47,8 +47,7 @@ void BattlegroundRV::CheckPositionForUnit(Unit* unit)
{ {
float groundZ_vmap = unit->GetMap()->GetHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, true, 50.0f); float groundZ_vmap = unit->GetMap()->GetHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, true, 50.0f);
float groundZ_dyntree = unit->GetMap()->GetDynamicMapTree().getHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, 50.0f, unit->GetPhaseMask()); float groundZ_dyntree = unit->GetMap()->GetDynamicMapTree().getHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, 50.0f, unit->GetPhaseMask());
if ((groundZ_vmap > 28.0f && groundZ_vmap < 29.0f) || if (groundZ_vmap > 28.0f && groundZ_vmap < 29.0f || groundZ_dyntree > 28.0f && groundZ_dyntree < 37.0f)
(groundZ_dyntree > 28.0f && groundZ_dyntree < 37.0f))
{ {
float groundZ = std::max<float>(groundZ_vmap, groundZ_dyntree); float groundZ = std::max<float>(groundZ_vmap, groundZ_dyntree);
if (unit->GetPositionZ() < groundZ - 0.2f || unit->GetPositionZ() > groundZ + 3.5f) if (unit->GetPositionZ() < groundZ - 0.2f || unit->GetPositionZ() > groundZ + 3.5f)
+3 -4
View File
@@ -380,8 +380,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
return; return;
} }
if ((ban && (_channelRights.flags & CHANNEL_RIGHT_CANT_BAN)) || if (ban && (_channelRights.flags & CHANNEL_RIGHT_CANT_BAN) || !ban && (_channelRights.flags & CHANNEL_RIGHT_CANT_KICK))
(!ban && (_channelRights.flags & CHANNEL_RIGHT_CANT_KICK)))
{ {
WorldPacket data; WorldPacket data;
MakeNotModerator(&data); MakeNotModerator(&data);
@@ -649,8 +648,8 @@ void Channel::SetOwner(Player const* player, std::string const& newname)
Player* newp = ObjectAccessor::FindPlayerByName(newname, false); Player* newp = ObjectAccessor::FindPlayerByName(newname, false);
uint64 victim = newp ? newp->GetGUID() : 0; uint64 victim = newp ? newp->GetGUID() : 0;
if (!victim || !IsOn(victim) || if (!victim || !IsOn(victim) || newp->GetTeamId() != player->GetTeamId() &&
(newp->GetTeamId() != player->GetTeamId() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))) !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
{ {
WorldPacket data; WorldPacket data;
MakePlayerNotFound(&data, newname); MakePlayerNotFound(&data, newname);
+1 -1
View File
@@ -2081,7 +2081,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
summon->SetHomePosition(pos); summon->SetHomePosition(pos);
summon->InitStats(duration); summon->InitStats(duration);
AddToMap(summon->ToCreature(), (IS_PLAYER_GUID(summon->GetOwnerGUID()) || (summoner && summoner->GetTransport()))); AddToMap(summon->ToCreature(), (IS_PLAYER_GUID(summon->GetOwnerGUID()) || summoner && summoner->GetTransport()));
summon->InitSummon(); summon->InitSummon();
//ObjectAccessor::UpdateObjectVisibility(summon); //ObjectAccessor::UpdateObjectVisibility(summon);
+5 -11
View File
@@ -4190,8 +4190,8 @@ void Player::removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporar
continue; continue;
// pussywizard: don't understand why whole skill is removed when just single spell from it is removed // pussywizard: don't understand why whole skill is removed when just single spell from it is removed
if ((_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL && pSkill->categoryId != SKILL_CATEGORY_CLASS) || // pussywizard: don't unlearn class skills if (_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL && pSkill->categoryId != SKILL_CATEGORY_CLASS || // pussywizard: don't unlearn class skills
((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0)) (pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0)
{ {
// not reset skills for professions and racial abilities // not reset skills for professions and racial abilities
if ((pSkill->categoryId == SKILL_CATEGORY_SECONDARY || pSkill->categoryId == SKILL_CATEGORY_PROFESSION) && (IsProfessionSkill(pSkill->id) || _spell_idx->second->racemask != 0)) if ((pSkill->categoryId == SKILL_CATEGORY_SECONDARY || pSkill->categoryId == SKILL_CATEGORY_PROFESSION) && (IsProfessionSkill(pSkill->id) || _spell_idx->second->racemask != 0))
@@ -17486,8 +17486,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
// pussywizard: group changed difficulty when player was offline, teleport to the enterance of new difficulty // pussywizard: group changed difficulty when player was offline, teleport to the enterance of new difficulty
if (mapEntry && ((mapEntry->IsNonRaidDungeon() && dungeonDiff != GetDungeonDifficulty()) || if (mapEntry && (mapEntry->IsNonRaidDungeon() && dungeonDiff != GetDungeonDifficulty() || mapEntry->IsRaid() && raidDiff != GetRaidDifficulty()))
(mapEntry->IsRaid() && raidDiff != GetRaidDifficulty())))
{ {
bool fixed = false; bool fixed = false;
if (uint32 destInstId = sInstanceSaveMgr->PlayerGetDestinationInstanceId(this, mapId, GetDifficulty(mapEntry->IsRaid()))) if (uint32 destInstId = sInstanceSaveMgr->PlayerGetDestinationInstanceId(this, mapId, GetDifficulty(mapEntry->IsRaid())))
@@ -22833,9 +22832,7 @@ void Player::ApplyEquipCooldown(Item* pItem)
// xinef: dont apply equip cooldown if spell on item has insignificant cooldown // xinef: dont apply equip cooldown if spell on item has insignificant cooldown
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId); SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
if (spellData.SpellCooldown <= 3000 && if (spellData.SpellCooldown <= 3000 && spellData.SpellCategoryCooldown <= 3000 && (!spellInfo || spellInfo->RecoveryTime <= 3000 && spellInfo->CategoryRecoveryTime <= 3000))
spellData.SpellCategoryCooldown <= 3000 &&
(!spellInfo || (spellInfo->RecoveryTime <= 3000 && spellInfo->CategoryRecoveryTime <= 3000)))
continue; continue;
// Don't replace longer cooldowns by equip cooldown if we have any. // Don't replace longer cooldowns by equip cooldown if we have any.
@@ -26366,10 +26363,7 @@ uint8 Player::GetMostPointsTalentTree() const
bool Player::IsHealerTalentSpec() const bool Player::IsHealerTalentSpec() const
{ {
uint8 tree = GetMostPointsTalentTree(); uint8 tree = GetMostPointsTalentTree();
return ((getClass() == CLASS_DRUID && tree == 2) || return (getClass() == CLASS_DRUID && tree == 2 || getClass() == CLASS_PALADIN && tree == 0 || getClass() == CLASS_PRIEST && tree <= 1 || getClass() == CLASS_SHAMAN && tree == 2);
(getClass() == CLASS_PALADIN && tree == 0) ||
(getClass() == CLASS_PRIEST && tree <= 1) ||
(getClass() == CLASS_SHAMAN && tree == 2));
} }
void Player::ResetTimeSync() void Player::ResetTimeSync()
+4 -8
View File
@@ -3368,16 +3368,13 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const
else if (c->GetMapId() == 631) // Icecrown Citadel else if (c->GetMapId() == 631) // Icecrown Citadel
{ {
// if static transport doesn't match - return false // if static transport doesn't match - return false
if (c->GetTransport() != this->GetTransport() && if (c->GetTransport() != this->GetTransport() && (c->GetTransport() && c->GetTransport()->IsStaticTransport() || this->GetTransport() && this->GetTransport()->IsStaticTransport()))
((c->GetTransport() && c->GetTransport()->IsStaticTransport()) ||
(this->GetTransport() && this->GetTransport()->IsStaticTransport())))
return false; return false;
// special handling for ICC (map 631), for non-flying pets in Gunship Battle, for trash npcs this is done via CanAIAttack // special handling for ICC (map 631), for non-flying pets in Gunship Battle, for trash npcs this is done via CanAIAttack
if (IS_PLAYER_GUID(c->GetOwnerGUID()) && !c->CanFly()) if (IS_PLAYER_GUID(c->GetOwnerGUID()) && !c->CanFly())
{ {
if ((c->GetTransport() && !this->GetTransport()) || if (c->GetTransport() && !this->GetTransport() || !c->GetTransport() && this->GetTransport())
(!c->GetTransport() && this->GetTransport()))
return false; return false;
if (this->GetTransport()) if (this->GetTransport())
{ {
@@ -3662,7 +3659,7 @@ void Unit::HandleSafeUnitPointersOnDelete(Unit* thisUnit)
bool Unit::IsInWater(bool allowAbove) const bool Unit::IsInWater(bool allowAbove) const
{ {
const_cast<Unit*>(this)->UpdateEnvironmentIfNeeded(1); const_cast<Unit*>(this)->UpdateEnvironmentIfNeeded(1);
return m_last_isinwater_status || (allowAbove && m_last_islittleabovewater_status); return m_last_isinwater_status || allowAbove && m_last_islittleabovewater_status;
} }
bool Unit::IsUnderWater() const bool Unit::IsUnderWater() const
@@ -10377,8 +10374,7 @@ float Unit::SpellPctDamageModsDone(Unit* victim, SpellInfo const* spellProto, Da
// Merciless Combat // Merciless Combat
if ((*i)->GetSpellInfo()->SpellIconID == 2656) if ((*i)->GetSpellInfo()->SpellIconID == 2656)
{ {
if (spellProto && if( spellProto && spellProto->SpellFamilyFlags[0] & 0x2 || spellProto->SpellFamilyFlags[1] & 0x2 )
((spellProto->SpellFamilyFlags[0] & 0x2) || (spellProto->SpellFamilyFlags[1] & 0x2)))
if (!victim->HealthAbovePct(35)) if (!victim->HealthAbovePct(35))
AddPct(DoneTotalMod, (*i)->GetAmount()); AddPct(DoneTotalMod, (*i)->GetAmount());
} }
+1 -7
View File
@@ -2368,13 +2368,7 @@ class Unit : public WorldObject
// pussywizard: // pussywizard:
// MMaps // MMaps
std::map<uint64, MMapTargetData> m_targetsNotAcceptable; std::map<uint64, MMapTargetData> m_targetsNotAcceptable;
bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = NULL) const { bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = NULL) const { std::map<uint64, MMapTargetData>::const_iterator itr = m_targetsNotAcceptable.find(guid); if (itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime || t && !itr->second.PosChanged(*this, *t))) return true; return false; }
std::map<uint64, MMapTargetData>::const_iterator itr = m_targetsNotAcceptable.find(guid);
if ((itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime)) ||
(t && !itr->second.PosChanged(*this, *t)))
return true;
return false;
}
uint32 m_mmapNotAcceptableStartTime; uint32 m_mmapNotAcceptableStartTime;
// Safe mover // Safe mover
std::set<SafeUnitPointer*> SafeUnitPointerSet; std::set<SafeUnitPointer*> SafeUnitPointerSet;
+2 -2
View File
@@ -1350,7 +1350,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
continue; continue;
player = ObjectAccessor::FindPlayer(itr->first); player = ObjectAccessor::FindPlayer(itr->first);
if (!player || (allowedMap != NULL && player->FindMap() != allowedMap)) if (!player || allowedMap != NULL && player->FindMap() != allowedMap)
{ {
--roll->totalNeed; --roll->totalNeed;
continue; continue;
@@ -1414,7 +1414,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
continue; continue;
player = ObjectAccessor::FindPlayer(itr->first); player = ObjectAccessor::FindPlayer(itr->first);
if (!player || (allowedMap != NULL && player->FindMap() != allowedMap)) if (!player || allowedMap != NULL && player->FindMap() != allowedMap)
{ {
--roll->totalGreed; --roll->totalGreed;
continue; continue;
+2 -5
View File
@@ -2073,11 +2073,8 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
// xinef: check money // xinef: check money
bool valid = Player::TeamIdForRace(oldRace) == Player::TeamIdForRace(race); bool valid = Player::TeamIdForRace(oldRace) == Player::TeamIdForRace(race);
if ((level < 10 && money <= 0) || if (level < 10 && money <= 0 || level > 10 && level <= 30 && money <= 3000000 || level > 30 && level <= 50 && money <= 10000000 ||
(level > 10 && level <= 30 && money <= 3000000) || level > 50 && level <= 70 && money <= 50000000 || level > 70 && money <= 200000000)
(level > 30 && level <= 50 && money <= 10000000) ||
(level > 50 && level <= 70 && money <= 50000000) ||
(level > 70 && money <= 200000000))
valid = true; valid = true;
if (!valid) if (!valid)
{ {
+3 -23
View File
@@ -398,7 +398,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/)
if (uint64 lguid = GetPlayer()->GetLootGUID()) if (uint64 lguid = GetPlayer()->GetLootGUID())
DoLootRelease(lguid); DoLootRelease(lguid);
bool instantLogout = (GetSecurity() >= sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT) || (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat())) || GetPlayer()->IsInFlight(); bool instantLogout = (GetSecurity() >= sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT) || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat()) || GetPlayer()->IsInFlight();
/// TODO: Possibly add RBAC permission to log out in combat /// TODO: Possibly add RBAC permission to log out in combat
bool canLogoutInCombat = GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); bool canLogoutInCombat = GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
@@ -1520,17 +1520,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
return; return;
} }
if (!groupGuy->IsAlive() || if (!groupGuy->IsAlive() || groupGuy->IsInCombat() || groupGuy->GetVictim() || groupGuy->m_mover != groupGuy || groupGuy->IsNonMeleeSpellCast(true) || !groupGuy->GetMotionMaster()->empty() && groupGuy->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE || !groupGuy->movespline->Finalized() || !groupGuy->GetMap()->ToInstanceMap() || !groupGuy->GetMap()->ToInstanceMap()->GetInstanceScript() || groupGuy->GetMap()->ToInstanceMap()->GetInstanceScript()->IsEncounterInProgress() || !groupGuy->Satisfy(sObjectMgr->GetAccessRequirement(groupGuy->GetMap()->GetId(), Difficulty(mode)), groupGuy->GetMap()->GetId(), false))
groupGuy->IsInCombat() ||
groupGuy->GetVictim() ||
groupGuy->m_mover != groupGuy ||
groupGuy->IsNonMeleeSpellCast(true) ||
(!groupGuy->GetMotionMaster()->empty() && groupGuy->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) ||
!groupGuy->movespline->Finalized() ||
!groupGuy->GetMap()->ToInstanceMap() ||
!groupGuy->GetMap()->ToInstanceMap()->GetInstanceScript() ||
groupGuy->GetMap()->ToInstanceMap()->GetInstanceScript()->IsEncounterInProgress() ||
!groupGuy->Satisfy(sObjectMgr->GetAccessRequirement(groupGuy->GetMap()->GetId(), Difficulty(mode)), groupGuy->GetMap()->GetId(), false))
{ {
_player->SendRaidDifficulty(group != NULL); _player->SendRaidDifficulty(group != NULL);
return; return;
@@ -1554,17 +1544,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
if (Player* p = itr->GetSource()) if (Player* p = itr->GetSource())
if (p->GetGroup() != group) if (p->GetGroup() != group)
{ {
if (!p->IsInWorld() || if (!p->IsInWorld() || !p->IsAlive() || p->IsInCombat() || p->GetVictim() || p->m_mover != p || p->IsNonMeleeSpellCast(true) || !p->GetMotionMaster()->empty() && p->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE || !p->movespline->Finalized() || !p->GetMap()->ToInstanceMap() || !p->GetMap()->ToInstanceMap()->GetInstanceScript() || p->GetMap()->ToInstanceMap()->GetInstanceScript()->IsEncounterInProgress())
!p->IsAlive() ||
p->IsInCombat() ||
p->GetVictim() ||
p->m_mover != p ||
p->IsNonMeleeSpellCast(true) ||
(!p->GetMotionMaster()->empty() && p->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) ||
!p->movespline->Finalized() ||
!p->GetMap()->ToInstanceMap() ||
!p->GetMap()->ToInstanceMap()->GetInstanceScript() ||
p->GetMap()->ToInstanceMap()->GetInstanceScript()->IsEncounterInProgress())
{ {
_player->SendRaidDifficulty(group != NULL); _player->SendRaidDifficulty(group != NULL);
return; return;
@@ -226,8 +226,8 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
} }
if (sourceCanSwim) if (sourceCanSwim)
{ {
if ((startPoly == INVALID_POLYREF && LIQUID_MAP_NO_WATER == _sourceUnit->GetBaseMap()->getLiquidStatus(startPos.x, startPos.y, startPos.z, MAP_ALL_LIQUIDS, NULL)) || if (startPoly == INVALID_POLYREF && LIQUID_MAP_NO_WATER == _sourceUnit->GetBaseMap()->getLiquidStatus(startPos.x, startPos.y, startPos.z, MAP_ALL_LIQUIDS, NULL) ||
(endPoly == INVALID_POLYREF && LIQUID_MAP_NO_WATER == _sourceUnit->GetBaseMap()->getLiquidStatus(endPos.x, endPos.y, endPos.z, MAP_ALL_LIQUIDS, NULL))) endPoly == INVALID_POLYREF && LIQUID_MAP_NO_WATER == _sourceUnit->GetBaseMap()->getLiquidStatus(endPos.x, endPos.y, endPos.z, MAP_ALL_LIQUIDS, NULL))
{ {
_type = PATHFIND_NOPATH; _type = PATHFIND_NOPATH;
return; return;
@@ -121,9 +121,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T* owner, bool ini
Position dest = {x, y, z, 0.0f}; Position dest = {x, y, z, 0.0f};
if (GameObject* pillar = ((BattlegroundRV*)bg)->GetPillarAtPosition(&dest)) if (GameObject* pillar = ((BattlegroundRV*)bg)->GetPillarAtPosition(&dest))
{ {
if ((pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() == 0) || if (pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() == 0 || owner->GetPositionZ() > 31.0f || owner->GetTransGUID() == pillar->GetGUID())
owner->GetPositionZ() > 31.0f ||
owner->GetTransGUID() == pillar->GetGUID())
{ {
if (pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() == 0) if (pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() == 0)
z = std::max(z, 28.28f); z = std::max(z, 28.28f);
@@ -137,8 +135,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T* owner, bool ini
init.Launch(); init.Launch();
return; return;
} }
if (pillar->GetGoState() == GO_STATE_ACTIVE || if (pillar->GetGoState() == GO_STATE_ACTIVE || pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() > 0)
(pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() > 0))
{ {
Position pos; Position pos;
owner->GetFirstCollisionPositionForTotem(pos, owner->GetExactDist2d(i_target.getTarget()), owner->GetAngle(i_target.getTarget())-owner->GetOrientation(), false); owner->GetFirstCollisionPositionForTotem(pos, owner->GetExactDist2d(i_target.getTarget()), owner->GetAngle(i_target.getTarget())-owner->GetOrientation(), false);
@@ -161,8 +158,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T* owner, bool ini
if (result) if (result)
{ {
float maxDist = MELEE_RANGE + owner->GetMeleeReach() + i_target->GetMeleeReach(); float maxDist = MELEE_RANGE + owner->GetMeleeReach() + i_target->GetMeleeReach();
if ((!forceDest && (i_path->GetPathType() & PATHFIND_NOPATH)) || if (!forceDest && (i_path->GetPathType() & PATHFIND_NOPATH || !i_offset && !isPlayerPet && i_target->GetExactDistSq(i_path->GetActualEndPosition().x, i_path->GetActualEndPosition().y, i_path->GetActualEndPosition().z) > maxDist*maxDist))
(!i_offset && !isPlayerPet && i_target->GetExactDistSq(i_path->GetActualEndPosition().x, i_path->GetActualEndPosition().y, i_path->GetActualEndPosition().z) > maxDist*maxDist))
{ {
lastPathingFailMSTime = World::GetGameTimeMS(); lastPathingFailMSTime = World::GetGameTimeMS();
owner->m_targetsNotAcceptable[i_target->GetGUID()] = MMapTargetData(sWorld->GetGameTime()+DISALLOW_TIME_AFTER_FAIL, owner, i_target.getTarget()); owner->m_targetsNotAcceptable[i_target->GetGUID()] = MMapTargetData(sWorld->GetGameTime()+DISALLOW_TIME_AFTER_FAIL, owner, i_target.getTarget());
+2 -4
View File
@@ -868,10 +868,8 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi)
*/ */
// pussywizard: remade this condition // pussywizard: remade this condition
bool canFly = GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) || bool canFly = GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) || GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) ||
GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || GetPlayer()->m_mover->GetTypeId() == TYPEID_UNIT && GetPlayer()->m_mover->ToCreature()->CanFly() || GetSecurity() > SEC_PLAYER;
(GetPlayer()->m_mover->GetTypeId() == TYPEID_UNIT && GetPlayer()->m_mover->ToCreature()->CanFly()) ||
GetSecurity() > SEC_PLAYER;
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && !canFly, REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && !canFly,
MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY);
+1 -2
View File
@@ -852,8 +852,7 @@ void Aura::RefreshTimersWithMods()
{ {
Unit* caster = GetCaster(); Unit* caster = GetCaster();
m_maxDuration = CalcMaxDuration(); m_maxDuration = CalcMaxDuration();
if ((caster && caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo)) || if (caster && caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION))
m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION))
m_maxDuration = int32(m_maxDuration * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); m_maxDuration = int32(m_maxDuration * caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
// xinef: we should take ModSpellDuration into account, but none of the spells using this function is affected by contents of ModSpellDuration // xinef: we should take ModSpellDuration into account, but none of the spells using this function is affected by contents of ModSpellDuration
+2 -2
View File
@@ -180,8 +180,8 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c
} }
bool bgPreparation = false; bool bgPreparation = false;
if ((!handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS) || if (!handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS ||
(handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS)) handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS)
{ {
bgPreparation = true; bgPreparation = true;
handler->SendSysMessage("Arena is not in progress yet. You will be invited as soon as it starts."); handler->SendSysMessage("Arena is not in progress yet. You will be invited as soon as it starts.");
@@ -394,8 +394,8 @@ public:
{ {
if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_NONE) if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_NONE)
{ {
if ((me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 192.0f && me->GetPositionY() < 206.0f) || if (me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 192.0f && me->GetPositionY() < 206.0f ||
(me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 240.0f && me->GetPositionY() < 254.0f)) me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 240.0f && me->GetPositionY() < 254.0f)
{ {
isInvincible = true; isInvincible = true;
if (SPELL_NECROLYTE_CHANNELING) if (SPELL_NECROLYTE_CHANNELING)
@@ -158,13 +158,8 @@ class boss_festergut : public CreatureScript
else if (Player* p = target->ToPlayer()) else if (Player* p = target->ToPlayer())
{ {
// Gaseous Blight damage // Gaseous Blight damage
if ((spell->Id == 69159 || if ((spell->Id == 69159 || spell->Id == 70136 || spell->Id == 69161 || spell->Id == 70139 || spell->Id == 69163 || spell->Id == 70469) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_10) == QUEST_STATUS_INCOMPLETE ||
spell->Id == 70136 || (spell->Id == 70135 || spell->Id == 70138 || spell->Id == 70468 || spell->Id == 70137 || spell->Id == 70140 || spell->Id == 70470) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_25) == QUEST_STATUS_INCOMPLETE)
spell->Id == 69161 ||
spell->Id == 70139 ||
spell->Id == 69163 ||
(spell->Id == 70469 && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_10) == QUEST_STATUS_INCOMPLETE)) ||
((spell->Id == 70135 || spell->Id == 70138 || spell->Id == 70468 || spell->Id == 70137 || spell->Id == 70140 || spell->Id == 70470) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_25) == QUEST_STATUS_INCOMPLETE))
p->CastSpell(p, SPELL_ORANGE_BLIGHT_RESIDUE, true); p->CastSpell(p, SPELL_ORANGE_BLIGHT_RESIDUE, true);
} }
} }
@@ -982,8 +982,7 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader
std::list<Creature*> creList; std::list<Creature*> creList;
GetCreatureListWithEntryInGrid(creList, GetCaster(), NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 200.0f); GetCreatureListWithEntryInGrid(creList, GetCaster(), NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 200.0f);
for (std::list<Creature*>::iterator itr = creList.begin(); itr != creList.end(); ++itr) for (std::list<Creature*>::iterator itr = creList.begin(); itr != creList.end(); ++itr)
if (((*itr)->GetPositionX() > 4350.0f && stage == 0) || if ((*itr)->GetPositionX() > 4350.0f && stage == 0 || (*itr)->GetPositionX() < 4350.0f && stage == 1)
((*itr)->GetPositionX() < 4350.0f && stage == 1))
{ {
target = (*itr); target = (*itr);
break; break;
@@ -881,14 +881,9 @@ public:
if (p->getClass() == CLASS_HUNTER) if (p->getClass() == CLASS_HUNTER)
return true; return true;
uint8 maxIndex = p->GetMostPointsTalentTree(); uint8 maxIndex = p->GetMostPointsTalentTree();
if ((p->getClass() == CLASS_PALADIN && maxIndex >= 1) || if (p->getClass() == CLASS_PALADIN && maxIndex >= 1 || p->getClass() == CLASS_SHAMAN && maxIndex == 1 || p->getClass() == CLASS_DRUID && maxIndex == 1)
(p->getClass() == CLASS_SHAMAN && maxIndex == 1) ||
(p->getClass() == CLASS_DRUID && maxIndex == 1))
return true; return true;
if (_removeHealers == (p->getClass() == CLASS_DRUID && maxIndex == 2) || if (_removeHealers == (p->getClass() == CLASS_DRUID && maxIndex == 2 || p->getClass() == CLASS_PALADIN && maxIndex == 0 || p->getClass() == CLASS_PRIEST && maxIndex <= 1 || p->getClass() == CLASS_SHAMAN && maxIndex == 2))
(p->getClass() == CLASS_PALADIN && maxIndex == 0) ||
(p->getClass() == CLASS_PRIEST && maxIndex <= 1) ||
(p->getClass() == CLASS_SHAMAN && maxIndex == 2))
return true; return true;
return false; return false;
@@ -377,8 +377,7 @@ public:
return false; return false;
if (_maxDist && _source->GetExactDist(target) > _maxDist) if (_maxDist && _source->GetExactDist(target) > _maxDist)
return false; return false;
if ((_exclude1 && target->HasAura(_exclude1)) || if (_exclude1 && target->HasAura(_exclude1) || _exclude2 && target->HasAura(_exclude2))
(_exclude2 && target->HasAura(_exclude2)))
return false; return false;
if (_reqLOS && !_source->IsWithinLOSInMap(target)) if (_reqLOS && !_source->IsWithinLOSInMap(target))
return false; return false;
@@ -1239,8 +1238,7 @@ class npc_tirion_fordring_tft : public CreatureScript
void Reset() void Reset()
{ {
_events.Reset(); _events.Reset();
if (_instance->GetBossState(DATA_THE_LICH_KING) == DONE || if (_instance->GetBossState(DATA_THE_LICH_KING) == DONE || me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE))
(me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE)))
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
} }
@@ -1312,8 +1310,7 @@ class npc_tirion_fordring_tft : public CreatureScript
void JustReachedHome() void JustReachedHome()
{ {
ScriptedAI::JustReachedHome(); ScriptedAI::JustReachedHome();
if (!(_instance->GetBossState(DATA_THE_LICH_KING) == DONE || if (!(_instance->GetBossState(DATA_THE_LICH_KING) == DONE || me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE)))
(me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE))))
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
} }
@@ -3231,8 +3231,7 @@ public:
--currPipeWP; --currPipeWP;
} }
me->SetHomePosition(VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ(), me->GetOrientation()); me->SetHomePosition(VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ(), me->GetOrientation());
if ((forward && currPipeWP == 3) || if (forward && currPipeWP == 3 || !forward && currPipeWP == 2)
(!forward && currPipeWP == 2))
me->GetMotionMaster()->MoveJump(VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ(), 10.0f, 6.0f, 1); me->GetMotionMaster()->MoveJump(VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ(), 10.0f, 6.0f, 1);
else else
me->GetMotionMaster()->MovePoint(1, VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ()); me->GetMotionMaster()->MovePoint(1, VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ());
@@ -3276,8 +3275,7 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
{ {
if ((creature->GetEntry() == NPC_GARROSH_HELLSCREAM && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11206) || if (creature->GetEntry() == NPC_GARROSH_HELLSCREAM && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11206 || creature->GetEntry() == NPC_KING_VARIAN_WRYNN && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11204)
(creature->GetEntry() == NPC_KING_VARIAN_WRYNN && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11204))
{ {
if (!player->GetGroup() || !player->GetGroup()->isRaidGroup() || !player->GetGroup()->IsLeader(player->GetGUID())) if (!player->GetGroup() || !player->GetGroup()->isRaidGroup() || !player->GetGroup()->IsLeader(player->GetGUID()))
{ {
@@ -526,8 +526,7 @@ class instance_icecrown_citadel : public InstanceMapScript
return entry; return entry;
return 0; return 0;
case NPC_SPIRE_FROSTWYRM: case NPC_SPIRE_FROSTWYRM:
if ((TeamIdInInstance == TEAM_ALLIANCE && data->posY < 2200.0f) || if (TeamIdInInstance == TEAM_ALLIANCE && data->posY < 2200.0f || TeamIdInInstance == TEAM_HORDE && data->posY > 2200.0f)
(TeamIdInInstance == TEAM_HORDE && data->posY > 2200.0f))
return 0; return 0;
break; break;
} }
@@ -275,9 +275,11 @@ class boss_algalon_the_observer : public CreatureScript
{ {
if (!item) // should not happen, but checked in GetAverageItemLevel() if (!item) // should not happen, but checked in GetAverageItemLevel()
return true; return true;
if (item->ItemLevel <= 226 || (item->ItemLevel <= 232 && (item->InventoryType == INVTYPE_SHIELD || if (item->ItemLevel <= 226 || item->ItemLevel <= 232 && (
item->InventoryType == INVTYPE_SHIELD ||
item->Class == ITEM_CLASS_WEAPON || item->Class == ITEM_CLASS_WEAPON ||
(item->Class == ITEM_CLASS_ARMOR && (item->InventoryType == INVTYPE_RELIC || item->InventoryType == INVTYPE_HOLDABLE))))) item->Class == ITEM_CLASS_ARMOR && (item->InventoryType == INVTYPE_RELIC || item->InventoryType == INVTYPE_HOLDABLE)
))
return true; return true;
return false; return false;
} }
@@ -470,8 +470,8 @@ public:
if( faction ) if( faction )
for( uint8 k=0; k<4; ++k ) for( uint8 k=0; k<4; ++k )
{ {
if((faction == 'A' && ( k>1 || (k==1 && RAID_MODE(1,0)) )) || if( faction == 'A' && ( k>1 || k==1 && RAID_MODE(1,0) ) ||
(faction == 'H' && ( k<2 || (k==3 && RAID_MODE(1,0)) )) ) faction == 'H' && ( k<2 || k==3 && RAID_MODE(1,0) ) )
continue; continue;
for( uint8 i=0; i<4; ++i ) for( uint8 i=0; i<4; ++i )
@@ -639,8 +639,7 @@ public:
if (me->IsSummon()) if (me->IsSummon())
if (Unit* s = me->ToTempSummon()->GetSummoner()) if (Unit* s = me->ToTempSummon()->GetSummoner())
{ {
if ((s->GetTypeId() == TYPEID_PLAYER && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER)) || if (s->GetTypeId() == TYPEID_PLAYER && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER) || s->GetTypeId() == TYPEID_UNIT && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))
(s->GetTypeId() == TYPEID_UNIT && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC)))
me->DespawnOrUnsummon(2000); me->DespawnOrUnsummon(2000);
else if (s->GetTypeId() == TYPEID_PLAYER) else if (s->GetTypeId() == TYPEID_PLAYER)
if (InstanceScript* pInstance = me->GetInstanceScript()) if (InstanceScript* pInstance = me->GetInstanceScript())
@@ -484,7 +484,7 @@ public:
if (!summon || summon->GetEntry() != NPC_OMINOUS_CLOUD || me->GetDistance(summon) < 20) if (!summon || summon->GetEntry() != NPC_OMINOUS_CLOUD || me->GetDistance(summon) < 20)
continue; continue;
if ((!cloud || (urand(0,1) && !summon->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS)))) if ((!cloud || urand(0,1) && !summon->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS)))
cloud = summon; cloud = summon;
} }
@@ -125,8 +125,7 @@ public:
Creature *pGuard1 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_1_GUID)); Creature *pGuard1 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_1_GUID));
Creature *pGuard2 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_2_GUID)); Creature *pGuard2 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_2_GUID));
if ((pGuard1 && !pGuard1->IsAlive()) || if (pGuard1 && !pGuard1->IsAlive() || pGuard2 && !pGuard2->IsAlive())
(pGuard2 && !pGuard2->IsAlive()))
{ {
events.RepeatEvent(urand(3000,6000)); events.RepeatEvent(urand(3000,6000));
break; break;
@@ -397,8 +397,7 @@ public:
pBoss->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); pBoss->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC);
pBoss->SetReactState(REACT_AGGRESSIVE); pBoss->SetReactState(REACT_AGGRESSIVE);
if ((WaveCount == 6 && m_auiEncounter[0] == DONE) || if (WaveCount == 6 && m_auiEncounter[0] == DONE || WaveCount == 12 && m_auiEncounter[1] == DONE)
(WaveCount == 12 && m_auiEncounter[1] == DONE))
pBoss->SetLootMode(0); pBoss->SetLootMode(0);
} }
} }