summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-23 13:29:05 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-23 13:29:05 +0000
commitfeeb1b0df2e02b06e68e1c6ab53d673798213ba4 (patch)
tree6de2f7a3735b5ea498b8580c406285b721b98c11 /src/map/script.c
parent060105016caf3edd7e2528412a42d6323a27921a (diff)
downloadhercules-feeb1b0df2e02b06e68e1c6ab53d673798213ba4.tar.gz
hercules-feeb1b0df2e02b06e68e1c6ab53d673798213ba4.tar.bz2
hercules-feeb1b0df2e02b06e68e1c6ab53d673798213ba4.tar.xz
hercules-feeb1b0df2e02b06e68e1c6ab53d673798213ba4.zip
- Fixed a possible SIGSEGV on buildin_maprespawnguildid if the map is unknown
- Added debug on "Inifity loop" to know which script is making this loop git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8451 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index cf101f156..40cf9e31a 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2659,6 +2659,7 @@ void run_script_main(struct script_state *st)
st->state = RUN;
if( gotocount>0 && (--gotocount)<=0 ){
ShowError("run_script: infinity loop !\n");
+ report_src(st);
st->state=END;
}
}
@@ -2706,6 +2707,7 @@ void run_script_main(struct script_state *st)
}
if( cmdcount>0 && (--cmdcount)<=0 ){
ShowError("run_script: infinity loop !\n");
+ report_src(st);
st->state=END;
}
}
@@ -8591,6 +8593,7 @@ int buildin_maprespawnguildid_sub(struct block_list *bl,va_list ap)
}
return 0;
}
+
int buildin_maprespawnguildid(struct script_state *st)
{
char *mapname=conv_str(st,& (st->stack->stack_data[st->start+2]));
@@ -8599,7 +8602,8 @@ int buildin_maprespawnguildid(struct script_state *st)
int m=map_mapname2mapid(mapname);
- if(m) map_foreachinmap(buildin_maprespawnguildid_sub,m,BL_CHAR,g_id,flag);
+ if(m != -1)
+ map_foreachinmap(buildin_maprespawnguildid_sub,m,BL_CHAR,g_id,flag);
return 0;
}