summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 03:52:56 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 03:52:56 +0000
commitaf2d2bc89af950fe2b780ef72ac6b0f8561ac950 (patch)
tree0044bf40e7f93ec7b089bfe6385bfc07c5cd58f2 /src/map/script.c
parent4107030428aa608b62524bcde7d211665ab83ca3 (diff)
downloadhercules-af2d2bc89af950fe2b780ef72ac6b0f8561ac950.tar.gz
hercules-af2d2bc89af950fe2b780ef72ac6b0f8561ac950.tar.bz2
hercules-af2d2bc89af950fe2b780ef72ac6b0f8561ac950.tar.xz
hercules-af2d2bc89af950fe2b780ef72ac6b0f8561ac950.zip
[Improved]:
- Fake NPC interface to use real NPCs. - Scripting interface to restore and save sd->npc_id. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6873 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 1707b59eb..6aa75d0fa 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11438,7 +11438,7 @@ int run_script(struct script_code *rootscript,int pos,int rid,int oid)
//Variables for backing up the previous script and restore it if needed. [Skotlex]
struct script_code *bck_script = NULL;
struct script_code *bck_scriptroot = NULL;
- int bck_scriptstate = 0;
+ int bck_scriptstate = 0,bck_npcid = 0;
struct script_stack *bck_stack = NULL;
if (rootscript == NULL || pos < 0)
@@ -11473,6 +11473,8 @@ int run_script(struct script_code *rootscript,int pos,int rid,int oid)
bck_scriptstate = sd->npc_scriptstate;
bck_stack = sd->stack;
sd->stack = NULL;
+ bck_npcid = sd->npc_id;
+ sd->npc_id = st->oid;
}
}
st->pos = pos;
@@ -11513,6 +11515,7 @@ int run_script(struct script_code *rootscript,int pos,int rid,int oid)
sd->npc_scriptroot = bck_scriptroot;
sd->npc_scriptstate = bck_scriptstate;
sd->stack = bck_stack;
+ sd->npc_id = bck_npcid;
//Since the script is done, save any changed account variables [Skotlex]
if (sd->state.reg_dirty&2)
intif_saveregistry(sd,2);