diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-23 14:14:55 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-23 14:14:55 +0000 |
commit | 3d45013b385eb15794af54322ea5e167c3abb595 (patch) | |
tree | 41ba474124ea1e7610d41e979a9e20915fa82bd6 /src/map/npc.c | |
parent | d3a1d512467e7a4ac1928558ea84e26898d5de3b (diff) | |
download | hercules-3d45013b385eb15794af54322ea5e167c3abb595.tar.gz hercules-3d45013b385eb15794af54322ea5e167c3abb595.tar.bz2 hercules-3d45013b385eb15794af54322ea5e167c3abb595.tar.xz hercules-3d45013b385eb15794af54322ea5e167c3abb595.zip |
- Added pc_bonus_autospell_del, gives support for removing autospell effects. When a negative rate is specified, it will decrease the chance of casting (eg: You have two different cards with autospell Heal +20% each, then do autospell -30. The second card will be cancelled, and the first one will become Heal +10%)
- npc_timers now will not restore the previous timer data when there's no players attached (when it's strictly an npc timer). This should reenable the old behaviour of getnpctimer returning the total ellapsed time since "startnpctimer" even after the last label has been reached. However, this behaviour won't apply to player-attached timers.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7312 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 1a6302abd..3d1557c1a 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -634,10 +634,12 @@ int npc_timerevent(int tid,unsigned int tick,int id,int data) ers_free(timer_event_ers, ted);
}
run_script(nd->u.scr.script,te->pos,nd->u.scr.rid,nd->bl.id);
- //Restore previous data.
- nd->u.scr.rid = old_rid;
- nd->u.scr.timer = old_timer;
- nd->u.scr.timertick = old_tick;
+ //Restore previous data, only if this timer is a player-attached one.
+ if (sd) {
+ nd->u.scr.rid = old_rid;
+ nd->u.scr.timer = old_timer;
+ nd->u.scr.timertick = old_tick;
+ }
return 0;
}
/*==========================================
|