diff options
author | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-09 16:10:44 +0000 |
---|---|---|
committer | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-09 16:10:44 +0000 |
commit | 76217d3ca250922d3a55ed73a55e22a678afd49f (patch) | |
tree | d34707f47d5ae08cafea553c3a5bcab702d87eea | |
parent | 6bd0769c68ca86c5454a360f46d0facbbc75cfe5 (diff) | |
download | hercules-76217d3ca250922d3a55ed73a55e22a678afd49f.tar.gz hercules-76217d3ca250922d3a55ed73a55e22a678afd49f.tar.bz2 hercules-76217d3ca250922d3a55ed73a55e22a678afd49f.tar.xz hercules-76217d3ca250922d3a55ed73a55e22a678afd49f.zip |
* [Fixed]:
- Execution of sleep/sleep2 more than once will hang the script_state.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7075 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 3 | ||||
-rw-r--r-- | src/map/script.c | 19 |
2 files changed, 14 insertions, 8 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 4dac143ab..6b8b978c3 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/06/09
+ * [Fixed]:
+ - Execution of sleep/sleep2 more than once will hang the script_state.
+ [Lance]
* Fixed @mapinfo displaying incorrectly maps with nosave which send you
back to your last savepoint. [Skotlex]
* Moved guild_exp_rate from a mapserver battle config setting to a char
diff --git a/src/map/script.c b/src/map/script.c index 9e082a61c..a7c9f4b6e 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11442,6 +11442,15 @@ int run_script_main(struct script_state *st) aFree(st); st = NULL; return 0; + }else{ + if(st->sleep.tick > 0) + { //Delay execution + TBL_PC *sd = (TBL_PC *)map_id2bl(st->rid); + st->sleep.charid = sd?sd->char_id:0; + st->sleep.timer = add_timer(gettick()+st->sleep.tick, + run_script_timer, st->sleep.charid, (int)st); + linkdb_insert(&sleep_db, (void*)st->oid, st); + } } return 1; @@ -11507,15 +11516,9 @@ int run_script(struct script_code *rootscript,int pos,int rid,int oid) st->sleep.timer = -1; if(run_script_main(st)){ - if(st->state != END){ + if (st->state != END){ pos = st->pos; - if(st->sleep.tick > 0) - { //Delay execution - st->sleep.charid = sd?sd->char_id:0; - st->sleep.timer = add_timer(gettick()+st->sleep.tick, - run_script_timer, st->sleep.charid, (int)st); - linkdb_insert(&sleep_db, (void*)st->oid, st); - } else if (sd) { + if(!st->sleep.tick && sd) { // script is not finished, store data in sd. sd->npc_script = st->script; sd->npc_scriptroot = rootscript; |