summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-25 03:20:32 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-25 03:20:32 +0000
commit32c467ffa83198173d5f818900a3cb2449385709 (patch)
treea60bfea39816664949792c248aacf1e4f7d9d089 /src/map
parent87f869a7b32d02b16e89f7abb6f202653fcf70e6 (diff)
downloadhercules-32c467ffa83198173d5f818900a3cb2449385709.tar.gz
hercules-32c467ffa83198173d5f818900a3cb2449385709.tar.bz2
hercules-32c467ffa83198173d5f818900a3cb2449385709.tar.xz
hercules-32c467ffa83198173d5f818900a3cb2449385709.zip
- Simplified npc_gettimerevent_tick so that it should return a tick value even after the last ontimer label has been reached.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6264 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/npc.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index fa803edfb..8f1445838 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -749,24 +749,8 @@ int npc_gettimerevent_tick(struct npc_data *nd)
nullpo_retr(0, nd);
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;
}
/*==========================================