Skip to content

Commit

Permalink
Fix special case of restarting fly path too soon on load
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife authored and cyberium committed Dec 19, 2016
1 parent 8d31cdd commit cc59060
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15966,6 +15966,7 @@ void Player::_LoadAuras(QueryResult* result, uint32 timediff)
if (caster_guid != GetObjectGuid() && holder->GetTrackedAuraType() == TRACK_AURA_TYPE_SINGLE_TARGET)
holder->SetTrackedAuraType(TRACK_AURA_TYPE_NOT_TRACKED);

holder->SetState(SPELLAURAHOLDER_STATE_DB_LOAD); // Safeguard mechanism against some actions
AddSpellAuraHolder(holder);
DETAIL_LOG("Added auras from spellid %u", spellproto->Id);
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8791,8 +8791,8 @@ void Aura::HandleAuraSafeFall(bool Apply, bool Real)
// implemented in WorldSession::HandleMovementOpcodes

// only special case
if (Apply && Real && GetId() == 32474 && GetTarget()->GetTypeId() == TYPEID_PLAYER)
((Player*)GetTarget())->ActivateTaxiPathTo(506, GetId());
if (Apply && Real && GetId() == 32474 && GetTarget()->GetTypeId() == TYPEID_PLAYER && GetHolder()->GetState() != SPELLAURAHOLDER_STATE_DB_LOAD)
((Player*)GetTarget())->ActivateTaxiPathTo(506, GetId()); // on DB load flight path is initiated on its own after its safe to do so
}

bool Aura::IsCritFromAbilityAura(Unit* caster, uint32& damage) const
Expand Down
3 changes: 2 additions & 1 deletion src/game/SpellAuras.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ enum SpellAuraHolderState
{
SPELLAURAHOLDER_STATE_CREATED = 0, // just created, initialization steps
SPELLAURAHOLDER_STATE_READY = 1, // all initialization steps are done
SPELLAURAHOLDER_STATE_REMOVING = 2 // removing steps
SPELLAURAHOLDER_STATE_REMOVING = 2, // removing steps
SPELLAURAHOLDER_STATE_DB_LOAD = 3 // during db load some events must not be executed
};

class MANGOS_DLL_SPEC SpellAuraHolder
Expand Down

0 comments on commit cc59060

Please sign in to comment.