Browse Source

- 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://svn.code.sf.net/p/rathena/svn/trunk@8451 54d463be-8e91-2dee-dedb-b68131a5f0ec

toms 19 years ago
parent
commit
cff4864a78
3 changed files with 9 additions and 2 deletions
  1. 3 0
      Changelog-Trunk.txt
  2. 1 1
      src/login_sql/login.c
  3. 5 1
      src/map/script.c

+ 3 - 0
Changelog-Trunk.txt

@@ -3,6 +3,9 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2006/08/23
+	* Fixed a possible SIGSEGV on buildin_maprespawnguildid if the map is unknown [Toms]
+	* Added debug on "Inifity loop" to know which script is making this loop [Toms]
 2006/08/22
 	* More fixes to the splash code. Kamaitachi and Sharpshooting should
 	  display correctly now. [Skotlex]

+ 1 - 1
src/login_sql/login.c

@@ -2300,7 +2300,7 @@ void sql_config_read(const char *cfgName){ /* Kalaspuff, to get login_db */
 void do_final(void) {
 	//sync account when terminating.
 	//but no need when you using DBMS (mysql)
-	ShowStatus("Terminating...\n");
+	ShowStatus("Terminating...\n");
 	mmo_db_close();
 	online_db->destroy(online_db, NULL);
 	if (gm_account_db)

+ 5 - 1
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;
 }