|
@@ -749,24 +749,8 @@ int npc_gettimerevent_tick(struct npc_data *nd)
|
|
nullpo_retr(0, nd);
|
|
nullpo_retr(0, nd);
|
|
|
|
|
|
tick=nd->u.scr.timer;
|
|
tick=nd->u.scr.timer;
|
|
-
|
|
|
|
- if (nd->u.scr.rid) {
|
|
|
|
- sd = map_id2sd(nd->u.scr.rid);
|
|
|
|
- if (!sd) {
|
|
|
|
- if(battle_config.error_log)
|
|
|
|
- ShowError("npc_gettimerevent_tick: Attached player not found!\n");
|
|
|
|
- return tick;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //If within a timer, set the tick value to the time passed since the beginning of the timer.
|
|
|
|
- if (sd) {
|
|
|
|
- if(sd->npc_timer_id != -1)
|
|
|
|
- tick += DIFF_TICK(gettick(), nd->u.scr.timertick);
|
|
|
|
- } else {
|
|
|
|
- if(nd->u.scr.timerid!=-1)
|
|
|
|
- tick += DIFF_TICK(gettick(), nd->u.scr.timertick);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ if (nd->u.scr.timertick)
|
|
|
|
+ tick+=DIFF_TICK(gettick(), nd->u.scr.timertick);
|
|
return tick;
|
|
return tick;
|
|
}
|
|
}
|
|
/*==========================================
|
|
/*==========================================
|