Skip to content

Commit

Permalink
[10214] Small final (as i think ;) ) fixes for restricted flight zone
Browse files Browse the repository at this point in the history
* Fixed my horriable typo in 58600 effect code. Thanks to zergtmn for pointing to it.
* Remove redundent cast 45472 in 58600 effect code (it casted from 58601 already). Thanks to porteyoplait.
* Prevent restart 58600 debuf timer at temporary leave zone and return to it.
  • Loading branch information
VladimirMangos committed Jul 17, 2010
1 parent 6859322 commit edda486
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6643,8 +6643,8 @@ void Player::UpdateArea(uint32 newArea)
if (area)
{
// Dalaran restricted flight zone
if ((area->flags & AREA_FLAG_CANNOT_FLY) && IsFreeFlying() && !isGameMaster())
CastSpell(this, 58600, true);
if ((area->flags & AREA_FLAG_CANNOT_FLY) && IsFreeFlying() && !isGameMaster() && !HasAura(58600))
CastSpell(this, 58600, true); // Restricted Flight Area

// TODO: implement wintergrasp parachute when battle in progress
/* if ((area->flags & AREA_FLAG_OUTDOOR_PVP) && IsFreeFlying() && <WINTERGRASP_BATTLE_IN_PROGRESS> && !isGameMaster())
Expand Down
7 changes: 2 additions & 5 deletions src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2172,13 +2172,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
AreaTableEntry const* area = GetAreaEntryByAreaID(target->GetAreaId());

// Dalaran restricted flight zone (recheck before apply unmount)
if (area && target->GetTargetGUID() == TYPEID_PLAYER && (area->flags & AREA_FLAG_CANNOT_FLY) &&
if (area && target->GetTypeId() == TYPEID_PLAYER && (area->flags & AREA_FLAG_CANNOT_FLY) &&
((Player*)target)->IsFreeFlying() && !((Player*)target)->isGameMaster())
{
// Remove Flight Auras
target->CastSpell(target, 58601, true);
// Parachute
target->CastSpell(target, 45472, true);
target->CastSpell(target, 58601, true); // Remove Flight Auras (also triggered Parachute (45472))
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10213"
#define REVISION_NR "10214"
#endif // __REVISION_NR_H__

0 comments on commit edda486

Please sign in to comment.