summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-22 12:15:49 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-22 12:15:49 +0000
commitde7175c5bc24b6e8f3b87540ae93f40a75df2df2 (patch)
tree4517d2916188504401ad86868e641edb35b40617 /src/map/npc.c
parentd0565d61b91c9784717e756c72b871099175408b (diff)
downloadhercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.tar.gz
hercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.tar.bz2
hercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.tar.xz
hercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.zip
* WARNING: New scripting system contains memory leak
TODO: Free all scripts using script_free_code() instead of old methods. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6690 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index d503d011a..4278d8d27 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1780,7 +1780,8 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
{
int x, y, dir = 0, m, xs = 0, ys = 0, class_ = 0; // [Valaris] thanks to fov
char mapname[MAP_NAME_LENGTH];
- unsigned char *srcbuf = NULL, *script;
+ unsigned char *srcbuf = NULL;
+ struct script_code *script;
int srcsize = 65536;
int startline = 0;
unsigned char line[1024];
@@ -1838,7 +1839,7 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
script = NULL;
} else {
// printf("Ok line %d\n",*lines);
- script = (unsigned char *) parse_script((unsigned char *) srcbuf, startline);
+ script = parse_script((unsigned char *) srcbuf, startline);
}
if (script == NULL) {
// script parse error?
@@ -1857,7 +1858,7 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
ShowError("bad duplicate name (in %s)! (not exist) : %s\n", current_file, srcname);
return 0;
}
- script = (unsigned char *)nd2->u.scr.script;
+ script = nd2->u.scr.script;
label_dup = nd2->u.scr.label_list;
label_dupnum = nd2->u.scr.label_list_num;
src_id = nd2->bl.id;
@@ -2027,7 +2028,8 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
*/
static int npc_parse_function (char *w1, char *w2, char *w3, char *w4, char *first_line, FILE *fp, int *lines)
{
- unsigned char *srcbuf, *script, *p;
+ unsigned char *srcbuf, *p;
+ struct script_code *script;
int srcsize = 65536;
int startline = 0;
char line[1024];