From 65a55ea396c44e263481302f8016fcf8b0e47a70 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 11 Jan 2014 18:22:42 -0200 Subject: Follow up 82b583b5ef4e729ad2c3c74b26adce16a145605a Fixed mapreg reload issue, sql_query not returning results, and caused deletearray to no longer display error messages when the array in question is not available. Special Thanks to Haruna, ossi0110 Signed-off-by: shennetsind --- src/map/mapreg_sql.c | 5 ++++- src/map/script.c | 17 +++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index 6df614aac..c2a35f930 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.c @@ -263,8 +263,11 @@ void mapreg_reload(void) { db_clear(mapreg->db); db_clear(mapreg->str_db); - if( mapreg->array_db ) + if( mapreg->array_db ) { mapreg->array_db->destroy(mapreg->array_db,script->array_free_db); + mapreg->array_db = NULL; + } + mapreg->load(); } diff --git a/src/map/script.c b/src/map/script.c index 7b640a237..5ed09b52a 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -5536,8 +5536,8 @@ BUILDIN(setarray) { struct script_data* data; const char* name; - int32 start; - int32 end; + uint32 start; + uint32 end; int32 id; int32 i; TBL_PC* sd = NULL; @@ -5587,8 +5587,8 @@ BUILDIN(cleararray) { struct script_data* data; const char* name; - int32 start; - int32 end; + uint32 start; + uint32 end; int32 id; void* v; TBL_PC* sd = NULL; @@ -5643,7 +5643,7 @@ BUILDIN(copyarray) int32 id2; void* v; int32 i; - int32 count; + uint32 count; TBL_PC* sd = NULL; data1 = script_getdata(st, 2); @@ -5780,10 +5780,7 @@ BUILDIN(deletearray) st->state = END; return false;// not a variable } else if ( !(sa = idb_get(src, id)) ) { /* non-existent array, nothing to empty */ - ShowError("script:deletearray: unknown array\n"); - script->reportdata(data); - st->state = END; - return false;// not a variable + return true;// not a variable } end = script->array_highest_key(st,sd,name); @@ -14436,7 +14433,7 @@ int buildin_query_sql_sub(struct script_state* st, Sql* handle) const char* query; struct script_data* data; const char* name; - int max_rows = SCRIPT_MAX_ARRAYSIZE; // maximum number of rows + unsigned int max_rows = SCRIPT_MAX_ARRAYSIZE; // maximum number of rows int num_vars; int num_cols; -- cgit v1.2.3-60-g2f50