* Now if an NPC is unloaded, only the timer of the player attached to this npc will be deleted.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13747 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
bb1c9d92de
commit
b6f136a75d
@ -1458,9 +1458,12 @@ int npc_unload(struct npc_data* nd)
|
||||
struct map_session_data *sd = map_id2sd(bl->id);
|
||||
if( sd && sd->npc_timer_id != INVALID_TIMER )
|
||||
{
|
||||
const struct TimerData *td = NULL;
|
||||
td = get_timer(sd->npc_timer_id);
|
||||
if (td && td->data)
|
||||
const struct TimerData *td = get_timer(sd->npc_timer_id);
|
||||
|
||||
if( td && td->id == nd->bl.id )
|
||||
continue;
|
||||
|
||||
if( td && td->data )
|
||||
ers_free(timer_event_ers, (void*)td->data);
|
||||
delete_timer(sd->npc_timer_id, npc_timerevent);
|
||||
sd->npc_timer_id = INVALID_TIMER;
|
||||
|
Loading…
x
Reference in New Issue
Block a user