Explorar o código

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8698 54d463be-8e91-2dee-dedb-b68131a5f0ec

Lupus %!s(int64=18) %!d(string=hai) anos
pai
achega
59e39f1b71
Modificáronse 4 ficheiros con 15 adicións e 10 borrados
  1. 5 0
      Changelog-Trunk.txt
  2. 2 2
      doc/script_commands.txt
  3. 1 0
      src/map/atcommand.c
  4. 7 8
      src/map/script.c

+ 5 - 0
Changelog-Trunk.txt

@@ -4,6 +4,11 @@ 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/09/10
+	* Thanks to KarLaeda, added missing function in @showmobs [Lupus]
+	- Script function 'query_sql': In the TXT version it doesn't fill the array
+	  and always return -1. Added for scripts compatibility. Your scripts
+	  won't crash in TXT version. They can work it around.
+		I suggest we need a function getversion()
 	* Updated item_db.sql and mob_db.sql [Playtester]
 2006/09/09
 	* Added a crash protection in case mapfreeblock unlock tries to free a null

+ 2 - 2
doc/script_commands.txt

@@ -9,7 +9,7 @@
 //= Maeki Rika - A section on general concepts and lots of
 //=              other updates and additions.
 //===== Version ===========================================
-//= 2.7c
+//= 2.8a
 //=========================================================
 //= 1.0 - First release, filled will as much info as I could
 //=       remember or figure out, most likely there are errors,
@@ -5031,7 +5031,7 @@ mes "3."+@name$[2]+"("+@fame[2]+")";
 mes "4."+@name$[3]+"("+@fame[3]+")";
 mes "5."+@name$[4]+"("+@fame[4]+")";
 
-Note: It is available in SQL version only.
+Note: In the TXT version it doesn't fill the array and always return -1.
 Note: Use Text$[] array to recieve all data as text.
 
 ---------------------------------------

+ 1 - 0
src/map/atcommand.c

@@ -10905,6 +10905,7 @@ void do_init_atcommand() {
 	users_db = db_alloc(__FILE__,__LINE__,DB_UINT,DB_OPT_BASE,sizeof(int));
 	duel_count = 0;
 	malloc_tsetdword(&duel_list[0], 0, sizeof(duel_list));
+	add_timer_func_list(atshowmobs_timer, "atshowmobs_timer");
 	return;
 }
 

+ 7 - 8
src/map/script.c

@@ -85,7 +85,7 @@ static struct dbt *userfunc_db=NULL;
 struct dbt* script_get_label_db(){ return scriptlabel_db; }
 struct dbt* script_get_userfunc_db(){ return userfunc_db; }
 
-static char pos[11][100] = {"頭","体","左手","右手","ローブ","靴","アクセサリー1","アクセサリー2","頭2","頭3","装着していない"};
+static char pos[11][100] = {"Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3","Not Equipped"};
 
 struct Script_Config script_config;
 static int parse_cmd;
@@ -3526,10 +3526,8 @@ int buildin_equip(struct script_state *st);
 int buildin_autoequip(struct script_state *st);
 int buildin_setbattleflag(struct script_state *st);
 int buildin_getbattleflag(struct script_state *st);
-#ifndef TXT_ONLY
 int buildin_query_sql(struct script_state *st);
 int buildin_escape_sql(struct script_state *st);
-#endif
 int buildin_atoi(struct script_state *st);
 int buildin_axtoi(struct script_state *st);
 // [zBuffer] List of player cont commands --->
@@ -3867,10 +3865,8 @@ struct script_function buildin_func[] = {
 	{buildin_undisguise,"undisguise","i"}, //undisguise player. Lupus
 	{buildin_getmonsterinfo,"getmonsterinfo","ii"}, //Lupus
 	{buildin_axtoi,"axtoi","s"},
-#ifndef TXT_ONLY
 	{buildin_query_sql, "query_sql", "s*"},
 	{buildin_escape_sql, "escape_sql", "s"},
-#endif
 	{buildin_atoi,"atoi","s"},
 	// [zBuffer] List of player cont commands --->
 	{buildin_rid2name,"rid2name","i"},
@@ -11215,8 +11211,8 @@ int buildin_setd(struct script_state *st)
 	return 0;
 }
 
-#ifndef TXT_ONLY
 int buildin_query_sql(struct script_state *st) {
+#ifndef TXT_ONLY
 	char *name = NULL, *query;
 	int num, i = 0,j, nb_rows;
 	struct { char * dst_var_name; char type; } row[32];
@@ -11248,7 +11244,7 @@ int buildin_query_sql(struct script_state *st) {
 
 		if (nb_rows > 32)
 		{
-			ShowWarning("buildin_query_sql: too much rows!\n");
+			ShowWarning("buildin_query_sql: too many rows!\n");
 			push_val(st->stack,C_INT,0);
 			return 1;
 		}
@@ -11286,6 +11282,10 @@ int buildin_query_sql(struct script_state *st) {
 		mysql_free_result(sql_res);
 	}
 	push_val(st->stack, C_INT, i);
+#else
+	//for TXT version, we always return -1
+	push_val(st->stack, C_INT, -1);
+#endif
 	return 0;
 }
 
@@ -11299,7 +11299,6 @@ int buildin_escape_sql(struct script_state *st) {
 	push_str(st->stack,C_STR,(unsigned char *)t_query);
 	return 0;
 }
-#endif
 
 int buildin_getd (struct script_state *st)
 {