aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/BattleGroundEY.cpp4
-rw-r--r--src/game/GameObject.cpp4
-rw-r--r--src/game/Player.cpp26
-rw-r--r--src/game/Player.h3
-rw-r--r--src/game/Spell.cpp2
-rw-r--r--src/game/SpellEffects.cpp4
-rw-r--r--src/shared/revision_nr.h2
7 files changed, 27 insertions, 18 deletions
diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGroundEY.cpp
index 49b6c29a7c3..b473a14df37 100644
--- a/src/game/BattleGroundEY.cpp
+++ b/src/game/BattleGroundEY.cpp
@@ -156,7 +156,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
++j;
continue;
}
- if (plr->isAllowUseBattleGroundObject() && plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
+ if (plr->CanCaptureTowerPoint() && plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
{
//player joined point!
//show progress bar
@@ -199,7 +199,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
++j;
continue;
}
- if (!plr->isAllowUseBattleGroundObject() || !plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
+ if (!plr->CanCaptureTowerPoint() || !plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
//move player out of point (add him to players that are out of points
{
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index 413cc9dda8e..8f620638b01 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -1252,7 +1252,7 @@ void GameObject::Use(Unit* user)
Player* player = (Player*)user;
- if( player->isAllowUseBattleGroundObject() )
+ if( player->CanUseBattleGroundObject() )
{
// in battleground check
BattleGround *bg = player->GetBattleGround();
@@ -1277,7 +1277,7 @@ void GameObject::Use(Unit* user)
Player* player = (Player*)user;
- if( player->isAllowUseBattleGroundObject() )
+ if( player->CanUseBattleGroundObject() )
{
// in battleground check
BattleGround *bg = player->GetBattleGround();
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 4ca33c693ea..64234151fc7 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -20104,15 +20104,23 @@ void Player::SetFarsightTarget(WorldObject* obj)
SetFarSightGUID(obj->GetGUID());
}
-bool Player::isAllowUseBattleGroundObject()
-{
- return ( //InBattleGround() && // in battleground - not need, check in other cases
- !IsMounted() && // not mounted
- !isTotalImmunity() && // not totally immuned
- !HasStealthAura() && // not stealthed
- !HasInvisibilityAura() && // not invisible
- !HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) && // can't pickup
- isAlive() // live player
+bool Player::CanUseBattleGroundObject()
+{
+ return ( //InBattleGround() && // in battleground - not need, check in other cases
+ //!IsMounted() && - not correct, player is dismounted when he clicks on flag
+ !HasStealthAura() && // not stealthed
+ !HasInvisibilityAura() && // not invisible
+ !HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) && // can't pickup
+ //TODO player cannot use object when he is invulnerable (immune) - (ice block, divine shield, divine protection, divine intervention ...)
+ isAlive() // live player
+ );
+}
+
+bool Player::CanCaptureTowerPoint()
+{
+ return ( !HasStealthAura() && // not stealthed
+ !HasInvisibilityAura() && // not invisible
+ isAlive() // live player
);
}
diff --git a/src/game/Player.h b/src/game/Player.h
index 932961c79c6..1de6f252791 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1984,8 +1984,9 @@ class TRINITY_DLL_SPEC Player : public Unit
void ClearAfkReports() { m_bgAfkReporter.clear(); }
bool GetBGAccessByLevel(BattleGroundTypeId bgTypeId) const;
- bool isAllowUseBattleGroundObject();
bool isTotalImmunity();
+ bool CanUseBattleGroundObject();
+ bool CanCaptureTowerPoint();
/*********************************************************/
/*** OUTDOOR PVP SYSTEM ***/
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index c35f67a68c6..2cba7f6ef10 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4070,7 +4070,7 @@ uint8 Spell::CanCast(bool strict)
// In BattleGround players can use only flags and banners
if( ((Player*)m_caster)->InBattleGround() &&
- !((Player*)m_caster)->isAllowUseBattleGroundObject() )
+ !((Player*)m_caster)->CanUseBattleGroundObject() )
return SPELL_FAILED_TRY_AGAIN;
// get the lock entry
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 12a7aa2078f..5eeeb7ff9a9 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3135,7 +3135,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
if( goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune ||
goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK )
{
- //isAllowUseBattleGroundObject() already called in CanCast()
+ //CanUseBattleGroundObject() already called in CanCast()
// in battleground check
if(BattleGround *bg = player->GetBattleGround())
{
@@ -3147,7 +3147,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
}
else if (goInfo->type == GAMEOBJECT_TYPE_FLAGSTAND)
{
- //isAllowUseBattleGroundObject() already called in CanCast()
+ //CanUseBattleGroundObject() already called in CanCast()
// in battleground check
if(BattleGround *bg = player->GetBattleGround())
{
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index b95fe701d19..53ea0267922 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "7425"
+ #define REVISION_NR "7426"
#endif // __REVISION_NR_H__