[9140] Let aura after seal do at least one finish tick for stealer.

* Set periodic to fit new aura max duration range for this
* This also prevent crash for soem auras at steal.
This commit is contained in:
VladimirMangos 2010-01-10 20:05:43 +03:00
parent 22a60b9018
commit 7db0ab735b
2 changed files with 9 additions and 4 deletions

View file

@ -4050,9 +4050,14 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
// set its duration and maximum duration // set its duration and maximum duration
// max duration 2 minutes (in msecs) // max duration 2 minutes (in msecs)
int32 dur = aur->GetAuraDuration(); int32 dur = aur->GetAuraDuration();
const int32 max_dur = 2*MINUTE*IN_MILISECONDS; int32 max_dur = 2*MINUTE*IN_MILISECONDS;
new_aur->SetAuraMaxDuration( max_dur > dur ? dur : max_dur ); int32 new_max_dur = max_dur > dur ? dur : max_dur;
new_aur->SetAuraDuration( max_dur > dur ? dur : max_dur ); new_aur->SetAuraMaxDuration( new_max_dur );
new_aur->SetAuraDuration( new_max_dur );
// set periodic to do at least one tick (for case when original aura has been at last tick preparing)
int32 periodic = aur->GetModifier()->periodictime;
new_aur->GetModifier()->periodictime = periodic < new_max_dur ? periodic : new_max_dur;
// Unregister _before_ adding to stealer // Unregister _before_ adding to stealer
aur->UnregisterSingleCastAura(); aur->UnregisterSingleCastAura();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9139" #define REVISION_NR "9140"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__