- Fixed typo in script.c

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5443 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
Lance 2006-03-03 08:40:24 +00:00
parent 348f88c110
commit 7f378f29f8
2 changed files with 12 additions and 12 deletions

View File

@ -10532,28 +10532,28 @@ static int script_load_mapreg(void)
return -1; return -1;
} }
ShowInfo("Success! Returning results ...\n"); ShowInfo("Success! Returning results ...\n");
mapregsql_res = mysql_store_result(&mmysql_handle); sql_res = mysql_store_result(&mmysql_handle);
if (mapregsql_res) { if (sql_res) {
while ((mapregsql_row = mysql_fetch_row(mapregsql_res))) { while ((sql_row = mysql_fetch_row(sql_res))) {
char buf1[33], *p = NULL; char buf1[33], *p = NULL;
int i,v,s; int i,v,s;
strcpy(buf1,mapregsql_row[0]); strcpy(buf1,sql_row[0]);
if( buf1[strlen(buf1)-1]=='$' ){ if( buf1[strlen(buf1)-1]=='$' ){
i = atoi(mapregsql_row[1]); i = atoi(sql_row[1]);
p=(char *)aCallocA(strlen(mapregsql_row[2]) + 1,sizeof(char)); p=(char *)aCallocA(strlen(sql_row[2]) + 1,sizeof(char));
strcpy(p,mapregsql_row[2]); strcpy(p,sql_row[2]);
s= add_str((unsigned char *) buf1); s= add_str((unsigned char *) buf1);
idb_put(mapregstr_db,(i<<24)|s,p); idb_put(mapregstr_db,(i<<24)|s,p);
}else{ }else{
s= add_str((unsigned char *) buf1); s= add_str((unsigned char *) buf1);
v= atoi(mapregsql_row[2]); v= atoi(sql_row[2]);
i = atoi(mapregsql_row[1]); i = atoi(sql_row[1]);
idb_put(mapreg_db,(i<<24)|s,(void *)v); idb_put(mapreg_db,(i<<24)|s,(void *)v);
} }
} }
} }
ShowInfo("Freeing results...\n"); ShowInfo("Freeing results...\n");
mysql_free_result(mapregsql_res); mysql_free_result(sql_res);
mapreg_dirty=0; mapreg_dirty=0;
perfomance = (gettick_nocache() - perfomance) / 1000; perfomance = (gettick_nocache() - perfomance) / 1000;
ShowInfo("SQL Mapreg Loading Completed Under %d Seconds.\n",perfomance); ShowInfo("SQL Mapreg Loading Completed Under %d Seconds.\n",perfomance);
@ -10582,7 +10582,7 @@ static int script_save_mapreg_intsub(DBKey key,void *data,va_list ap)
char *name=str_buf+str_data[num].str; char *name=str_buf+str_data[num].str;
if ( name[1] != '@') { if ( name[1] != '@') {
sprintf(tmp_sql,"UPDATE `%s` SET `%s`='%d' WHERE `%s`='%s' AND `%s`='%d'",mapregsql_db,mapregsql_db_value,(int)data,mapregsql_db_varname,name,mapregsql_db_index,i); sprintf(tmp_sql,"UPDATE `%s` SET `%s`='%d' WHERE `%s`='%s' AND `%s`='%d'",mapregsql_db,mapregsql_db_value,(int)data,mapregsql_db_varname,name,mapregsql_db_index,i);
if(mysql_query(&mmyregsql_handle, tmp_sql) ) { if(mysql_query(&mmysql_handle, tmp_sql) ) {
ShowSQL("DB error - %s\n",mysql_error(&mmysql_handle)); ShowSQL("DB error - %s\n",mysql_error(&mmysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql); ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
} }

View File

@ -20,7 +20,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql" AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;PACKETVER=6;NEW_006b;__WIN32;LOCALZLIB;PCRE_SUPPORT;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;PACKETVER=6;NEW_006b;__WIN32;LOCALZLIB;PCRE_SUPPORT;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION;MAPREGSQL"
GeneratePreprocessedFile="0" GeneratePreprocessedFile="0"
MinimalRebuild="FALSE" MinimalRebuild="FALSE"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"