Skip to content

Commit

Permalink
Definitions for DB Pathing (#3964)
Browse files Browse the repository at this point in the history
* Added the use of DBPATH/DBIMPORT definition for guild EXP, job information, level penalties, and map cache to remove hardcoded values.
Thanks to @marky291!
  • Loading branch information
marky291 authored and aleos89 committed Feb 22, 2019
1 parent 7e64920 commit a5c93b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/char/int_guild.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/map/map.cpp
Expand Up @@ -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++ ){
Expand Down
6 changes: 3 additions & 3 deletions src/map/pc.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a5c93b6

Please sign in to comment.