mirror of
https://github.com/mangosfour/server.git
synced 2025-12-19 04:37:06 +00:00
Instead mark spell as delatable mark it as executed and referenced from Unit current spells array and not deleted spell in like cases.
This is solve crashs if spell deleted at caster die in result triggered spells casting chain from currently executed spell.
This commit is contained in:
parent
322b201c4d
commit
ed7390dede
7 changed files with 61 additions and 25 deletions
|
|
@ -38,6 +38,8 @@ class BasicEvent
|
|||
// e_time is execution time, p_time is update interval
|
||||
virtual bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) { return true; }
|
||||
|
||||
virtual bool IsDeletable() const { return true; } // this event can be safely deleted
|
||||
|
||||
virtual void Abort(uint64 /*e_time*/) {} // this method executes when the event is aborted
|
||||
|
||||
bool to_Abort; // set by externals when the event is aborted, aborted events don't execute
|
||||
|
|
@ -57,7 +59,7 @@ class EventProcessor
|
|||
~EventProcessor();
|
||||
|
||||
void Update(uint32 p_time);
|
||||
void KillAllEvents();
|
||||
void KillAllEvents(bool force);
|
||||
void AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime = true);
|
||||
uint64 CalculateTime(uint64 t_offset);
|
||||
protected:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue