aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/BattleGroundHandler.cpp3
-rw-r--r--src/game/Level1.cpp26
-rw-r--r--src/game/Player.cpp14
-rw-r--r--src/game/Player.h1
-rw-r--r--src/game/Spell.cpp5
-rw-r--r--src/game/TaxiHandler.cpp5
6 files changed, 33 insertions, 21 deletions
diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp
index c8bc2bc4ecf..497db2ceadd 100644
--- a/src/game/BattleGroundHandler.cpp
+++ b/src/game/BattleGroundHandler.cpp
@@ -448,7 +448,8 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
if (_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
+ _player->CleanupAfterTaxiFlight();
+
}
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType());
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index 7477801dff7..be86e9dd78f 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -852,7 +852,7 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
if (target->isInFlight())
{
target->GetMotionMaster()->MovementExpired();
- target->m_taxi.ClearTaxiDestinations();
+ target->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -988,7 +988,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
if (_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
+ _player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -1021,7 +1021,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
if (_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
+ _player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -1055,7 +1055,7 @@ bool ChatHandler::HandleRecallCommand(const char* args)
if(target->isInFlight())
{
target->GetMotionMaster()->MovementExpired();
- target->m_taxi.ClearTaxiDestinations();
+ target->CleanupAfterTaxiFlight();
}
target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO);
@@ -2241,7 +2241,7 @@ bool ChatHandler::HandleTeleCommand(const char * args)
if(_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
+ _player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -2504,7 +2504,7 @@ bool ChatHandler::HandleTeleNameCommand(const char * args)
if(target->isInFlight())
{
target->GetMotionMaster()->MovementExpired();
- target->m_taxi.ClearTaxiDestinations();
+ target->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -2600,7 +2600,7 @@ bool ChatHandler::HandleTeleGroupCommand(const char * args)
if(pl->isInFlight())
{
pl->GetMotionMaster()->MovementExpired();
- pl->m_taxi.ClearTaxiDestinations();
+ pl->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -2689,7 +2689,7 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
if(pl->isInFlight())
{
pl->GetMotionMaster()->MovementExpired();
- pl->m_taxi.ClearTaxiDestinations();
+ pl->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -2739,7 +2739,7 @@ bool ChatHandler::HandleGoTaxinodeCommand(const char* args)
if (_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
+ _player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -2782,7 +2782,7 @@ bool ChatHandler::HandleGoXYCommand(const char* args)
if(_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
+ _player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -2832,7 +2832,7 @@ bool ChatHandler::HandleGoXYZCommand(const char* args)
if(_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
+ _player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -2903,7 +2903,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
if(_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
+ _player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
@@ -2950,7 +2950,7 @@ bool ChatHandler::HandleGoGridCommand(const char* args)
if(_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
+ _player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 0a90f721899..e8e45c96db4 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17230,6 +17230,10 @@ void Player::RestoreSpellMods(Spell * spell)
else
mod->charges++;
+ // Do not set more spellmods than avalible
+ if (mod->ownerAura->GetAuraCharges() < mod->charges)
+ mod->charges = mod->ownerAura->GetAuraCharges();
+
// Skip this check for now - aura charges may change due to various reason
// TODO: trac these changes correctly
//assert (mod->ownerAura->GetAuraCharges() <= mod->charges);
@@ -17656,6 +17660,14 @@ bool Player::ActivateTaxiPathTo( uint32 taxi_path_id, uint32 spellid /*= 0*/ )
return ActivateTaxiPathTo(nodes,NULL,spellid);
}
+void Player::CleanupAfterTaxiFlight()
+{
+ m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
+ Unmount();
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
+ getHostilRefManager().setOnlineOfflineState(true);
+}
+
void Player::ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
{
// last check 2.0.10
@@ -19366,7 +19378,7 @@ void Player::SummonIfPossible(bool agree)
if(isInFlight())
{
GetMotionMaster()->MovementExpired();
- m_taxi.ClearTaxiDestinations();
+ CleanupAfterTaxiFlight();
}
// drop flag at summon
diff --git a/src/game/Player.h b/src/game/Player.h
index 12f1ec66722..45403e94612 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -905,6 +905,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); }
bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc = NULL, uint32 spellid = 0);
bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 0);
+ void CleanupAfterTaxiFlight();
// mount_id can be used in scripting calls
bool isAcceptWhispers() const { return m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS; }
void SetAcceptWhispers(bool on) { if(on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 656eb106152..214fc2cc0bc 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -3278,9 +3278,10 @@ void Spell::finish(bool ok)
}
// potions disabled by client, send event "not in combat" if need
- if (!m_triggeredByAuraSpell && m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
- ((Player*)m_caster)->UpdatePotionCooldown(this);
+ if (!m_triggeredByAuraSpell)
+ ((Player*)m_caster)->UpdatePotionCooldown(this);
// triggered spell pointer can be not set in some cases
// this is needed for proper apply of triggered spell mods
diff --git a/src/game/TaxiHandler.cpp b/src/game/TaxiHandler.cpp
index 0587eba4a64..5655bfd57bb 100644
--- a/src/game/TaxiHandler.cpp
+++ b/src/game/TaxiHandler.cpp
@@ -256,11 +256,8 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& /*recv_data*/)
return;
}
- GetPlayer()->m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
- GetPlayer()->Unmount();
- GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
+ GetPlayer()->CleanupAfterTaxiFlight();
GetPlayer()->SetFallInformation(0, GetPlayer()->GetPositionZ());
- GetPlayer()->getHostilRefManager().setOnlineOfflineState(true);
if(GetPlayer()->pvpInfo.inHostileArea)
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
}