diff options
author | QAston <none@none> | 2009-07-01 16:18:37 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-07-01 16:18:37 +0200 |
commit | fd86e6a369b03d496988673f97409c5b74e99c52 (patch) | |
tree | ca8573e0a44ac5e68cb7d641d2f72f478c8bd38c /src/game/Player.cpp | |
parent | 6c7e41cf87d61411296f18660e3ca538d51e2096 (diff) |
*Fix possible exploits with flying paths.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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 |