mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
*Tabs to spaces
*Fix a type in CreatureEventAI.cpp from last rev --HG-- branch : trunk
This commit is contained in:
@@ -1067,7 +1067,7 @@ int ChatHandler::ParseCommands(const char* text)
|
||||
std::string fullcmd = text;
|
||||
|
||||
if (m_session && m_session->GetSecurity() <= SEC_PLAYER && sWorld.getConfig(CONFIG_ALLOW_PLAYER_COMMANDS) == 0)
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
if (m_session && !m_session->HandleOnPlayerChat(text))
|
||||
return 0;
|
||||
|
||||
@@ -511,8 +511,8 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
||||
if (!processChatmessageFurtherAfterSecurityChecks(msg, lang))
|
||||
return;
|
||||
|
||||
if (_player->getLevel() < sWorld.getConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||
return;
|
||||
if (_player->getLevel() < sWorld.getConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||
return;
|
||||
|
||||
if(msg.empty())
|
||||
break;
|
||||
|
||||
@@ -311,7 +311,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
||||
|
||||
//Note: checked only aura for effect 0, if need check aura for effect 1/2 then
|
||||
// possible way: pack in event.buffed.amount 2 uint16 (ammount+effectIdx)
|
||||
Aura const * aura = m_creature->GetAura(event.buffed.spellId);
|
||||
Aura const * aura = pActionInvoker->GetAura(event.buffed.spellId);
|
||||
if(!aura || aura->GetStackAmount() < event.buffed.amount)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -298,15 +298,15 @@ void MapManager::Update(uint32 diff)
|
||||
MapMapType::iterator iter = i_maps.begin();
|
||||
for (; iter != i_maps.end(); ++iter)
|
||||
{
|
||||
if (m_updater.activated())
|
||||
if (m_updater.activated())
|
||||
m_updater.schedule_update(*iter->second, i_timer.GetCurrent());
|
||||
else
|
||||
else
|
||||
{
|
||||
iter->second->Update(i_timer.GetCurrent());
|
||||
}
|
||||
iter->second->Update(i_timer.GetCurrent());
|
||||
}
|
||||
}
|
||||
if (m_updater.activated())
|
||||
m_updater.wait();
|
||||
m_updater.wait();
|
||||
|
||||
for (iter = i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
iter->second->DelayedUpdate(i_timer.GetCurrent());
|
||||
|
||||
@@ -385,11 +385,11 @@ void AuraEffect::GetTargetList(std::list<Unit *> & targetList) const
|
||||
{
|
||||
Aura::ApplicationMap const & targetMap = GetBase()->GetApplicationMap();
|
||||
// remove all targets which were not added to new list - they no longer deserve area aura
|
||||
for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); appIter++)
|
||||
{
|
||||
for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); appIter++)
|
||||
{
|
||||
if(appIter->second->HasEffect(GetEffIndex()))
|
||||
targetList.push_back(appIter->second->GetTarget());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int32 AuraEffect::CalculateAmount(Unit * caster)
|
||||
@@ -397,11 +397,11 @@ int32 AuraEffect::CalculateAmount(Unit * caster)
|
||||
int32 amount;
|
||||
// default amount calculation
|
||||
if(caster)
|
||||
amount = caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_baseAmount, NULL);
|
||||
amount = caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_baseAmount, NULL);
|
||||
else
|
||||
amount = m_baseAmount + m_spellProto->EffectBaseDice[m_effIndex];
|
||||
|
||||
// check item enchant aura cast
|
||||
// check item enchant aura cast
|
||||
if(!amount && caster)
|
||||
if(uint64 itemGUID = GetBase()->GetCastItemGUID())
|
||||
if(Player *playerCaster = dynamic_cast<Player*>(caster))
|
||||
|
||||
@@ -1253,7 +1253,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
|
||||
|
||||
void Aura::SetNeedClientUpdateForTargets() const
|
||||
{
|
||||
for (ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
|
||||
for (ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
|
||||
appIter->second->SetNeedClientUpdate();
|
||||
}
|
||||
|
||||
@@ -1343,9 +1343,9 @@ void UnitAura::UpdateTargetMapForEffect(Unit * caster, uint8 effIndex)
|
||||
}
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
|
||||
{
|
||||
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher
|
||||
Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(GetUnitOwner(), targets, u_check);
|
||||
GetUnitOwner()->VisitNearbyObject(radius, searcher);
|
||||
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher
|
||||
Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(GetUnitOwner(), targets, u_check);
|
||||
GetUnitOwner()->VisitNearbyObject(radius, searcher);
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_PET:
|
||||
@@ -1361,7 +1361,7 @@ void UnitAura::UpdateTargetMapForEffect(Unit * caster, uint8 effIndex)
|
||||
}
|
||||
|
||||
// mark all auras as ready to remove
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); appIter++)
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); appIter++)
|
||||
if (appIter->second->HasEffect(effIndex))
|
||||
appIter->second->_SetCanBeRemoved(true);
|
||||
|
||||
@@ -1381,8 +1381,8 @@ void UnitAura::UpdateTargetMapForEffect(Unit * caster, uint8 effIndex)
|
||||
if (*appIter != GetOwner())
|
||||
{
|
||||
bool addUnit = true;
|
||||
// check if not stacking aura already on target
|
||||
// this one prevents unwanted usefull buff loss because of stacking and prevents overriding auras periodicaly by 2 near area aura owners
|
||||
// check if not stacking aura already on target
|
||||
// this one prevents unwanted usefull buff loss because of stacking and prevents overriding auras periodicaly by 2 near area aura owners
|
||||
for (Unit::AuraApplicationMap::iterator iter = (*appIter)->GetAppliedAuras().begin(); iter != (*appIter)->GetAppliedAuras().end(); ++iter)
|
||||
{
|
||||
Aura const * aura = iter->second->GetBase();
|
||||
@@ -1401,8 +1401,8 @@ void UnitAura::UpdateTargetMapForEffect(Unit * caster, uint8 effIndex)
|
||||
{
|
||||
if((*appIter)->IsImmunedToSpellEffect(GetSpellProto(), effIndex))
|
||||
continue;
|
||||
// add new unit to persistent area aura
|
||||
(*appIter)->_ApplyAuraEffect(this, effIndex);
|
||||
// add new unit to persistent area aura
|
||||
(*appIter)->_ApplyAuraEffect(this, effIndex);
|
||||
|
||||
// start combat with targeted enemy
|
||||
if(GetSpellProto()->Effect[effIndex] == SPELL_EFFECT_APPLY_AREA_AURA_ENEMY)
|
||||
@@ -1416,7 +1416,7 @@ void UnitAura::UpdateTargetMapForEffect(Unit * caster, uint8 effIndex)
|
||||
}
|
||||
|
||||
// remove auras which are not in current area
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end();)
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end();)
|
||||
{
|
||||
AuraApplication * aurApp = appIter->second;
|
||||
++appIter;
|
||||
@@ -1456,13 +1456,13 @@ void DynObjAura::UpdateTargetMapForEffect(Unit * caster, uint8 effIndex)
|
||||
}
|
||||
else
|
||||
{
|
||||
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targets, u_check);
|
||||
GetDynobjOwner()->VisitNearbyObject(radius, searcher);
|
||||
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targets, u_check);
|
||||
GetDynobjOwner()->VisitNearbyObject(radius, searcher);
|
||||
}
|
||||
|
||||
// mark all auras as ready to remove
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); appIter++)
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); appIter++)
|
||||
if (appIter->second->HasEffect(effIndex))
|
||||
appIter->second->_SetCanBeRemoved(true);
|
||||
|
||||
@@ -1485,8 +1485,8 @@ void DynObjAura::UpdateTargetMapForEffect(Unit * caster, uint8 effIndex)
|
||||
{
|
||||
if((*appIter)->IsImmunedToSpellEffect(GetSpellProto(), effIndex))
|
||||
continue;
|
||||
// add new unit to persistent area aura
|
||||
(*appIter)->_ApplyAuraEffect(this, effIndex);
|
||||
// add new unit to persistent area aura
|
||||
(*appIter)->_ApplyAuraEffect(this, effIndex);
|
||||
|
||||
// start combat with targeted enemy
|
||||
if(GetSpellProto()->EffectImplicitTargetB[effIndex] != TARGET_DEST_DYNOBJ_ALLY
|
||||
@@ -1501,7 +1501,7 @@ void DynObjAura::UpdateTargetMapForEffect(Unit * caster, uint8 effIndex)
|
||||
}
|
||||
|
||||
// remove auras which are not in current area
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end();)
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end();)
|
||||
{
|
||||
AuraApplication * aurApp = appIter->second;
|
||||
++appIter;
|
||||
|
||||
@@ -38,11 +38,11 @@ class AuraApplication
|
||||
friend AuraApplication * Unit::__ApplyAura(Aura * aura);
|
||||
friend void Unit::__UnapplyAura(AuraApplicationMap::iterator &i);
|
||||
friend bool Unit::_ApplyAuraEffect(Aura * aura, uint8 effIndex);
|
||||
private:
|
||||
Unit * const m_target;
|
||||
Aura * const m_base;
|
||||
uint8 m_slot; // Aura slot on unit
|
||||
uint8 m_flags; // Aura info flag
|
||||
private:
|
||||
Unit * const m_target;
|
||||
Aura * const m_base;
|
||||
uint8 m_slot; // Aura slot on unit
|
||||
uint8 m_flags; // Aura info flag
|
||||
AuraRemoveMode m_removeMode:8; // Store info for know remove aura reason
|
||||
bool m_needClientUpdate:1;
|
||||
bool m_isNeedManyNegativeEffects:1;
|
||||
@@ -53,15 +53,15 @@ class AuraApplication
|
||||
private:
|
||||
bool _CheckPositive(Unit * caster) const;
|
||||
void _HandleEffect(uint8 effIndex, bool apply);
|
||||
public:
|
||||
public:
|
||||
bool _CanBeRemoved() const {return m_canBeRemoved;}
|
||||
void _SetCanBeRemoved(bool val) {m_canBeRemoved = val;}
|
||||
|
||||
Unit * GetTarget() const { return m_target; }
|
||||
Aura * GetBase() const { return m_base; }
|
||||
|
||||
uint8 GetSlot() const { return m_slot; }
|
||||
uint8 GetFlags() const { return m_flags; }
|
||||
uint8 GetSlot() const { return m_slot; }
|
||||
uint8 GetFlags() const { return m_flags; }
|
||||
uint8 GetEffectMask() const { return m_flags & (AFLAG_EFF_INDEX_0 | AFLAG_EFF_INDEX_1 | AFLAG_EFF_INDEX_2); }
|
||||
bool HasEffect(uint8 effect) const { assert(effect < MAX_SPELL_EFFECTS); return m_flags & (1<<effect); }
|
||||
bool IsPositive() const { return m_flags & AFLAG_POSITIVE; }
|
||||
@@ -175,12 +175,12 @@ class TRINITY_DLL_SPEC Aura
|
||||
int32 m_duration; // Current time
|
||||
int32 m_timeCla; // Timer for power per sec calcultion
|
||||
|
||||
uint8 const m_casterLevel; // Aura level (store caster level for correct show level dep amount)
|
||||
uint8 const m_casterLevel; // Aura level (store caster level for correct show level dep amount)
|
||||
uint8 m_procCharges; // Aura charges (0 for infinite)
|
||||
uint8 m_stackAmount; // Aura stack amount
|
||||
|
||||
AuraEffect * m_effects[3];
|
||||
ApplicationMap m_applications;
|
||||
ApplicationMap m_applications;
|
||||
|
||||
bool m_isRemoved:1;
|
||||
bool m_isSingleTarget:1; // true if it's a single target spell and registered at caster - can change at spell steal for example
|
||||
|
||||
@@ -830,14 +830,14 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
" AND (RealmID = '%d'"
|
||||
" OR RealmID = '-1')",
|
||||
id, realmID);
|
||||
if(!result)
|
||||
security = 0;
|
||||
else
|
||||
{
|
||||
fields = result->Fetch ();
|
||||
security = fields[1].GetInt32();
|
||||
delete result;
|
||||
}
|
||||
if(!result)
|
||||
security = 0;
|
||||
else
|
||||
{
|
||||
fields = result->Fetch ();
|
||||
security = fields[1].GetInt32();
|
||||
delete result;
|
||||
}
|
||||
|
||||
// Re-check account ban (same check as in realmd)
|
||||
QueryResult *banresult =
|
||||
|
||||
Reference in New Issue
Block a user