From a5c93b60a6e9f4660038bfaf5439ab3ea271eea8 Mon Sep 17 00:00:00 2001 From: Mark Hester Date: Fri, 22 Feb 2019 14:02:08 +0000 Subject: [PATCH] Definitions for DB Pathing (#3964) * Added the use of DBPATH/DBIMPORT definition for guild EXP, job information, level penalties, and map cache to remove hardcoded values. Thanks to @marky291! --- src/char/int_guild.cpp | 2 +- src/map/map.cpp | 2 +- src/map/pc.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/char/int_guild.cpp b/src/char/int_guild.cpp index 66a3f404e7..b273d9413b 100644 --- a/src/char/int_guild.cpp +++ b/src/char/int_guild.cpp @@ -750,7 +750,7 @@ int inter_guild_CharOffline(uint32 char_id, int guild_id) // Initialize guild sql int inter_guild_sql_init(void) { - const char *filename[]={ DBPATH"exp_guild.txt","import/exp_guild.txt"}; + const char *filename[]={ DBPATH"exp_guild.txt", DBIMPORT"/exp_guild.txt"}; int i; //Initialize the guild cache guild_db_= idb_alloc(DB_OPT_RELEASE_DATA); diff --git a/src/map/map.cpp b/src/map/map.cpp index 18d7a37d7b..2eb219df06 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -3772,7 +3772,7 @@ int map_readallmaps (void) else { const char* mapcachefilepath[] = { "db/" DBPATH "map_cache.dat", - "db/import/map_cache.dat" + "db/" DBIMPORT "/map_cache.dat" }; for( int i = 0; i < 2; i++ ){ diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 5aace7ecb8..49cb2f3130 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -11618,7 +11618,7 @@ void pc_readdb(void) { memset(job_info,0,sizeof(job_info)); // job_info table #if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) - sv_readdb(db_path, "re/level_penalty.txt", ',', 4, 4, -1, &pc_readdb_levelpenalty, 0); + sv_readdb(db_path, DBPATH "level_penalty.txt", ',', 4, 4, -1, &pc_readdb_levelpenalty, 0); sv_readdb(db_path, DBIMPORT"/level_penalty.txt", ',', 4, 4, -1, &pc_readdb_levelpenalty, 1); for( k=1; k < 3; k++ ){ // fill in the blanks int j; @@ -11656,9 +11656,9 @@ void pc_readdb(void) { s = pc_read_statsdb(dbsubpath2,s,i > 0); if (i == 0) #ifdef RENEWAL_ASPD - sv_readdb(dbsubpath1, "re/job_db1.txt",',',6+MAX_WEAPON_TYPE,6+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1, false); + sv_readdb(dbsubpath1, DBPATH "job_db1.txt",',',6+MAX_WEAPON_TYPE,6+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1, false); #else - sv_readdb(dbsubpath1, "pre-re/job_db1.txt",',',5+MAX_WEAPON_TYPE,5+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1, false); + sv_readdb(dbsubpath1, DBPATH "job_db1.txt",',',5+MAX_WEAPON_TYPE,5+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1, false); #endif else sv_readdb(dbsubpath1, "job_db1.txt",',',5+MAX_WEAPON_TYPE,6+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1, true);