* 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,8 +1458,11 @@ int npc_unload(struct npc_data* nd)
|
|||||||
struct map_session_data *sd = map_id2sd(bl->id);
|
struct map_session_data *sd = map_id2sd(bl->id);
|
||||||
if( sd && sd->npc_timer_id != INVALID_TIMER )
|
if( sd && sd->npc_timer_id != INVALID_TIMER )
|
||||||
{
|
{
|
||||||
const struct TimerData *td = NULL;
|
const struct TimerData *td = get_timer(sd->npc_timer_id);
|
||||||
td = get_timer(sd->npc_timer_id);
|
|
||||||
|
if( td && td->id == nd->bl.id )
|
||||||
|
continue;
|
||||||
|
|
||||||
if( td && td->data )
|
if( td && td->data )
|
||||||
ers_free(timer_event_ers, (void*)td->data);
|
ers_free(timer_event_ers, (void*)td->data);
|
||||||
delete_timer(sd->npc_timer_id, npc_timerevent);
|
delete_timer(sd->npc_timer_id, npc_timerevent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user