summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 05:27:49 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 05:27:49 +0000
commita6fa88b228e6f2d0bb7e0847254108da7b9c6114 (patch)
tree5bb4a3d390e9489eae7ba49dbbdbbdf7f51290c9
parent78b8c9896c2f4170e7fa0ea502ac1026525f8174 (diff)
downloadhercules-a6fa88b228e6f2d0bb7e0847254108da7b9c6114.tar.gz
hercules-a6fa88b228e6f2d0bb7e0847254108da7b9c6114.tar.bz2
hercules-a6fa88b228e6f2d0bb7e0847254108da7b9c6114.tar.xz
hercules-a6fa88b228e6f2d0bb7e0847254108da7b9c6114.zip
[Fixed]:
- Logic errors in run_script git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6875 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/script.c19
2 files changed, 13 insertions, 8 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 6db79dfca..061fefb29 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,8 @@ 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/05/31
+ * [Fixed]:
+ - Logic errors in run_script [Lance]
* [Added]:
- Partial support for latest login packet. But it seems to have a new security
module. [Lance]
diff --git a/src/map/script.c b/src/map/script.c
index 6aa75d0fa..95b97ac9f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11467,14 +11467,17 @@ int run_script(struct script_code *rootscript,int pos,int rid,int oid)
st->state = RUN;
st->script = rootscript;
- if (sd && sd->stack) { // if there's a sd and a stack - back it up and restore it if possible.
- bck_script = sd->npc_script;
- bck_scriptroot = sd->npc_scriptroot;
- bck_scriptstate = sd->npc_scriptstate;
- bck_stack = sd->stack;
- sd->stack = NULL;
- bck_npcid = sd->npc_id;
- sd->npc_id = st->oid;
+ if (sd){
+ if(sd->stack) {
+ // if there's a sd and a stack - back it up and restore it if possible.
+ bck_script = sd->npc_script;
+ bck_scriptroot = sd->npc_scriptroot;
+ bck_scriptstate = sd->npc_scriptstate;
+ bck_stack = sd->stack;
+ sd->stack = NULL;
+ bck_npcid = sd->npc_id;
+ }
+ sd->npc_id = oid;
}
}
st->pos = pos;