mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
converted all tabs to 4 spaces
This commit is contained in:
@@ -71,11 +71,11 @@ void VisibleNotifier::SendToSelf()
|
||||
|
||||
for (Player::ClientGUIDs::const_iterator it = vis_guids.begin();it != vis_guids.end(); ++it)
|
||||
{
|
||||
// pussywizard: static transports are removed only in RemovePlayerFromMap and here if can no longer detect (eg. phase changed)
|
||||
if (IS_TRANSPORT_GUID(*it))
|
||||
if (GameObject* staticTrans = i_player.GetMap()->GetGameObject(*it))
|
||||
if (i_player.CanSeeOrDetect(staticTrans, false, true))
|
||||
continue;
|
||||
// pussywizard: static transports are removed only in RemovePlayerFromMap and here if can no longer detect (eg. phase changed)
|
||||
if (IS_TRANSPORT_GUID(*it))
|
||||
if (GameObject* staticTrans = i_player.GetMap()->GetGameObject(*it))
|
||||
if (i_player.CanSeeOrDetect(staticTrans, false, true))
|
||||
continue;
|
||||
|
||||
i_player.m_clientGUIDs.erase(*it);
|
||||
i_data.AddOutOfRangeGUID(*it);
|
||||
@@ -127,11 +127,11 @@ void VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
void VisibleChangesNotifier::Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (IS_PLAYER_GUID(iter->GetSource()->GetCasterGUID()))
|
||||
if (Unit* caster = iter->GetSource()->GetCaster())
|
||||
if (Player* player = caster->ToPlayer())
|
||||
if (player->m_seer == iter->GetSource())
|
||||
player->UpdateVisibilityOf(&i_object);
|
||||
if (IS_PLAYER_GUID(iter->GetSource()->GetCasterGUID()))
|
||||
if (Unit* caster = iter->GetSource()->GetCaster())
|
||||
if (Player* player = caster->ToPlayer())
|
||||
if (player->m_seer == iter->GetSource())
|
||||
player->UpdateVisibilityOf(&i_object);
|
||||
}
|
||||
|
||||
inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
|
||||
@@ -140,7 +140,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
|
||||
return;
|
||||
|
||||
if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STATE_SIGHTLESS))
|
||||
if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
|
||||
if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
|
||||
c->AI()->MoveInLineOfSight_Safe(u);
|
||||
}
|
||||
|
||||
@@ -161,11 +161,11 @@ void CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
Player* player = iter->GetSource();
|
||||
|
||||
// NOTIFY_VISIBILITY_CHANGED does not guarantee that player will do it himself (because distance is also checked), but screw it, it's not that important
|
||||
// NOTIFY_VISIBILITY_CHANGED does not guarantee that player will do it himself (because distance is also checked), but screw it, it's not that important
|
||||
if (!player->m_seer->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
|
||||
player->UpdateVisibilityOf(&i_creature);
|
||||
|
||||
// NOTIFY_AI_RELOCATION does not guarantee that player will do it himself (because distance is also checked), but screw it, it's not that important
|
||||
// NOTIFY_AI_RELOCATION does not guarantee that player will do it himself (because distance is also checked), but screw it, it's not that important
|
||||
if (!player->m_seer->isNeedNotify(NOTIFY_AI_RELOCATION) && !i_creature.IsMoveInLineOfSightStrictlyDisabled())
|
||||
CreatureUnitRelocationWorker(&i_creature, player);
|
||||
}
|
||||
@@ -173,16 +173,16 @@ void CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
|
||||
void AIRelocationNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
bool self = isCreature && !((Creature*)(&i_unit))->IsMoveInLineOfSightStrictlyDisabled();
|
||||
bool self = isCreature && !((Creature*)(&i_unit))->IsMoveInLineOfSightStrictlyDisabled();
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Creature* c = iter->GetSource();
|
||||
|
||||
// NOTIFY_VISIBILITY_CHANGED | NOTIFY_AI_RELOCATION does not guarantee that unit will do it itself (because distance is also checked), but screw it, it's not that important
|
||||
if (!c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED | NOTIFY_AI_RELOCATION) && !c->IsMoveInLineOfSightStrictlyDisabled())
|
||||
CreatureUnitRelocationWorker(c, &i_unit);
|
||||
// NOTIFY_VISIBILITY_CHANGED | NOTIFY_AI_RELOCATION does not guarantee that unit will do it itself (because distance is also checked), but screw it, it's not that important
|
||||
if (!c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED | NOTIFY_AI_RELOCATION) && !c->IsMoveInLineOfSightStrictlyDisabled())
|
||||
CreatureUnitRelocationWorker(c, &i_unit);
|
||||
|
||||
if (self)
|
||||
if (self)
|
||||
CreatureUnitRelocationWorker((Creature*)&i_unit, c);
|
||||
}
|
||||
}
|
||||
@@ -239,9 +239,9 @@ void MessageDistDeliverer::Visit(DynamicObjectMapType &m)
|
||||
if (!IS_PLAYER_GUID(target->GetCasterGUID()) || !target->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
// Xinef: Check whether the dynobject allows to see through it
|
||||
if (!target->IsViewpoint())
|
||||
continue;
|
||||
// Xinef: Check whether the dynobject allows to see through it
|
||||
if (!target->IsViewpoint())
|
||||
continue;
|
||||
|
||||
if (target->GetExactDist2dSq(i_source) > i_distSq)
|
||||
continue;
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Trinity
|
||||
Player const* skipped_receiver;
|
||||
MessageDistDeliverer(WorldObject* src, WorldPacket* msg, float dist, bool own_team_only = false, Player const* skipped = NULL)
|
||||
: i_source(src), i_message(msg), i_phaseMask(src->GetPhaseMask()), i_distSq(dist * dist)
|
||||
, teamId((own_team_only && src->GetTypeId() == TYPEID_PLAYER) ? src->ToPlayer()->GetTeamId() : TEAM_NEUTRAL)
|
||||
, teamId((own_team_only && src->GetTypeId() == TYPEID_PLAYER) ? src->ToPlayer()->GetTeamId() : TEAM_NEUTRAL)
|
||||
, skipped_receiver(skipped)
|
||||
{
|
||||
}
|
||||
@@ -124,7 +124,7 @@ namespace Trinity
|
||||
}
|
||||
};
|
||||
|
||||
struct MessageDistDelivererToHostile
|
||||
struct MessageDistDelivererToHostile
|
||||
{
|
||||
Unit* i_source;
|
||||
WorldPacket* i_message;
|
||||
@@ -625,8 +625,8 @@ namespace Trinity
|
||||
if (go->GetGOInfo()->type != GAMEOBJECT_TYPE_SPELL_FOCUS)
|
||||
return false;
|
||||
|
||||
if (!go->isSpawned()) // xinef: dont allow to count deactivated objects
|
||||
return false;
|
||||
if (!go->isSpawned()) // xinef: dont allow to count deactivated objects
|
||||
return false;
|
||||
|
||||
if (go->GetGOInfo()->spellFocus.focusId != i_focusId)
|
||||
return false;
|
||||
@@ -785,12 +785,12 @@ namespace Trinity
|
||||
{
|
||||
public:
|
||||
FriendlyMissingBuffInRange(Unit const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range)
|
||||
{
|
||||
i_spell = spellid;
|
||||
if( SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellid) )
|
||||
if( SpellInfo const* newSpell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, const_cast<Unit*>(obj)) )
|
||||
i_spell = newSpell->Id;
|
||||
}
|
||||
{
|
||||
i_spell = spellid;
|
||||
if( SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellid) )
|
||||
if( SpellInfo const* newSpell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, const_cast<Unit*>(obj)) )
|
||||
i_spell = newSpell->Id;
|
||||
}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
@@ -813,7 +813,7 @@ namespace Trinity
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u) &&
|
||||
(i_funit->GetTypeId() != TYPEID_UNIT || !i_funit->ToCreature()->IsAvoidingAOE())) // pussywizard
|
||||
(i_funit->GetTypeId() != TYPEID_UNIT || !i_funit->ToCreature()->IsAvoidingAOE())) // pussywizard
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -833,10 +833,10 @@ namespace Trinity
|
||||
if (!u->IsAlive())
|
||||
return false;
|
||||
|
||||
if (u->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
|
||||
return false;
|
||||
if (u->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
|
||||
return false;
|
||||
|
||||
if (u->GetTypeId() == TYPEID_UNIT && (u->ToCreature()->IsTotem() || u->ToCreature()->IsTrigger() || u->ToCreature()->IsAvoidingAOE())) // pussywizard: added IsAvoidingAOE()
|
||||
if (u->GetTypeId() == TYPEID_UNIT && (u->ToCreature()->IsTotem() || u->ToCreature()->IsTrigger() || u->ToCreature()->IsAvoidingAOE())) // pussywizard: added IsAvoidingAOE()
|
||||
return false;
|
||||
|
||||
if (!u->isTargetableForAttack(false, i_funit))
|
||||
@@ -863,7 +863,7 @@ namespace Trinity
|
||||
&& !i_funit->IsFriendlyTo(u)
|
||||
&& i_funit->IsValidAttackTarget(u)
|
||||
&& !u->IsCritter()
|
||||
&& !u->IsTotem() //xinef: dont attack totems
|
||||
&& !u->IsTotem() //xinef: dont attack totems
|
||||
/*&& i_funit->CanSeeOrDetect(u)*/; // pussywizard: already checked in IsValidAttackTarget(u)
|
||||
}
|
||||
private:
|
||||
@@ -1018,7 +1018,7 @@ namespace Trinity
|
||||
float i_range;
|
||||
};
|
||||
|
||||
class AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck
|
||||
class AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck
|
||||
{
|
||||
public:
|
||||
AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range)
|
||||
@@ -1031,9 +1031,9 @@ namespace Trinity
|
||||
}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (!u->IsAlive() || u->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE) || (u->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) && !u->IsInCombat()))
|
||||
if (!u->IsAlive() || u->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE) || (u->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) && !u->IsInCombat()))
|
||||
return false;
|
||||
if (u->GetGUID() == i_funit->GetGUID())
|
||||
if (u->GetGUID() == i_funit->GetGUID())
|
||||
return false;
|
||||
|
||||
if (i_obj->IsWithinDistInMap(u, i_range))
|
||||
@@ -1240,8 +1240,8 @@ namespace Trinity
|
||||
if (_reqAlive && !u->IsAlive())
|
||||
return false;
|
||||
|
||||
if (_disallowGM && (u->IsGameMaster() || u->IsSpectator()))
|
||||
return false;
|
||||
if (_disallowGM && (u->IsGameMaster() || u->IsSpectator()))
|
||||
return false;
|
||||
|
||||
if (!_obj->IsWithinDistInMap(u, _range))
|
||||
return false;
|
||||
@@ -1262,7 +1262,7 @@ namespace Trinity
|
||||
WorldObject const* _obj;
|
||||
float _range;
|
||||
bool _reqAlive;
|
||||
bool _disallowGM;
|
||||
bool _disallowGM;
|
||||
};
|
||||
|
||||
class NearestPlayerInObjectRangeCheck
|
||||
@@ -1411,7 +1411,7 @@ namespace Trinity
|
||||
|
||||
private:
|
||||
uint64 _GUID;
|
||||
bool _equals;
|
||||
bool _equals;
|
||||
};
|
||||
|
||||
class UnitAuraCheck
|
||||
@@ -1434,61 +1434,61 @@ namespace Trinity
|
||||
uint64 _casterGUID;
|
||||
};
|
||||
|
||||
class AllWorldObjectsInExactRange
|
||||
class AllWorldObjectsInExactRange
|
||||
{
|
||||
public:
|
||||
AllWorldObjectsInExactRange(const WorldObject* object, float range, bool equals) : _object(object), _range(range), _equals(equals) { }
|
||||
bool operator() (WorldObject const* object)
|
||||
{
|
||||
return (_object->GetExactDist2d(object) > _range) == _equals;
|
||||
}
|
||||
public:
|
||||
AllWorldObjectsInExactRange(const WorldObject* object, float range, bool equals) : _object(object), _range(range), _equals(equals) { }
|
||||
bool operator() (WorldObject const* object)
|
||||
{
|
||||
return (_object->GetExactDist2d(object) > _range) == _equals;
|
||||
}
|
||||
|
||||
private:
|
||||
const WorldObject* _object;
|
||||
float _range;
|
||||
bool _equals;
|
||||
private:
|
||||
const WorldObject* _object;
|
||||
float _range;
|
||||
bool _equals;
|
||||
};
|
||||
|
||||
class RandomCheck
|
||||
{
|
||||
public:
|
||||
explicit RandomCheck(uint8 chance) : _chance(chance) { }
|
||||
bool operator()(WorldObject const* object) const
|
||||
{
|
||||
return roll_chance_i(_chance);
|
||||
}
|
||||
class RandomCheck
|
||||
{
|
||||
public:
|
||||
explicit RandomCheck(uint8 chance) : _chance(chance) { }
|
||||
bool operator()(WorldObject const* object) const
|
||||
{
|
||||
return roll_chance_i(_chance);
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 const _chance;
|
||||
};
|
||||
|
||||
class PowerCheck
|
||||
{
|
||||
public:
|
||||
explicit PowerCheck(Powers const power, bool equals) : _power(power), _equals(equals) { }
|
||||
bool operator()(WorldObject const* object) const
|
||||
{
|
||||
return object->ToUnit() && (object->ToUnit()->getPowerType() == _power) == _equals;
|
||||
}
|
||||
private:
|
||||
uint8 const _chance;
|
||||
};
|
||||
|
||||
class PowerCheck
|
||||
{
|
||||
public:
|
||||
explicit PowerCheck(Powers const power, bool equals) : _power(power), _equals(equals) { }
|
||||
bool operator()(WorldObject const* object) const
|
||||
{
|
||||
return object->ToUnit() && (object->ToUnit()->getPowerType() == _power) == _equals;
|
||||
}
|
||||
|
||||
private:
|
||||
Powers const _power;
|
||||
bool const _equals;
|
||||
};
|
||||
private:
|
||||
Powers const _power;
|
||||
bool const _equals;
|
||||
};
|
||||
|
||||
class RaidCheck
|
||||
{
|
||||
public:
|
||||
explicit RaidCheck(Unit const* compare, bool equals) : _compare(compare), _equals(equals) { }
|
||||
bool operator()(WorldObject const* object) const
|
||||
{
|
||||
return object->ToUnit() && object->ToUnit()->IsInRaidWith(_compare) == _equals;
|
||||
}
|
||||
class RaidCheck
|
||||
{
|
||||
public:
|
||||
explicit RaidCheck(Unit const* compare, bool equals) : _compare(compare), _equals(equals) { }
|
||||
bool operator()(WorldObject const* object) const
|
||||
{
|
||||
return object->ToUnit() && object->ToUnit()->IsInRaidWith(_compare) == _equals;
|
||||
}
|
||||
|
||||
private:
|
||||
Unit const* _compare;
|
||||
bool const _equals;
|
||||
};
|
||||
private:
|
||||
Unit const* _compare;
|
||||
bool const _equals;
|
||||
};
|
||||
|
||||
// Player checks and do
|
||||
|
||||
|
||||
@@ -123,8 +123,8 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<Gam
|
||||
for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
|
||||
{
|
||||
uint32 guid = *i_guid;
|
||||
GameObjectData const* data = sObjectMgr->GetGOData(guid);
|
||||
GameObject* obj = data && sObjectMgr->IsGameObjectStaticTransport(data->id) ? new StaticTransport() : new GameObject();
|
||||
GameObjectData const* data = sObjectMgr->GetGOData(guid);
|
||||
GameObject* obj = data && sObjectMgr->IsGameObjectStaticTransport(data->id) ? new StaticTransport() : new GameObject();
|
||||
//sLog->outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading", table, guid);
|
||||
if (!obj->LoadFromDB(guid, map))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user