diff options
author | lordttseven <lordttseven@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-18 13:32:13 +0000 |
---|---|---|
committer | lordttseven <lordttseven@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-18 13:32:13 +0000 |
commit | 59dc4717ad51d0d756a9097495868577b7433054 (patch) | |
tree | a678e3303bc5c0486b87f70e1ccbd33643d2b676 /src/map | |
parent | 062e6a90f493c6a2cd6b3ec8ae30cade9b58983d (diff) | |
download | hercules-59dc4717ad51d0d756a9097495868577b7433054.tar.gz hercules-59dc4717ad51d0d756a9097495868577b7433054.tar.bz2 hercules-59dc4717ad51d0d756a9097495868577b7433054.tar.xz hercules-59dc4717ad51d0d756a9097495868577b7433054.zip |
* uncluttered DB paths between REMODE on/off a little
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15719 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/config/Data/Const.h | 9 | ||||
-rw-r--r-- | src/map/homunculus.c | 6 | ||||
-rw-r--r-- | src/map/itemdb.c | 18 | ||||
-rw-r--r-- | src/map/mob.c | 22 | ||||
-rw-r--r-- | src/map/pc.c | 30 | ||||
-rw-r--r-- | src/map/skill.c | 19 | ||||
-rw-r--r-- | src/map/status.c | 7 |
7 files changed, 35 insertions, 76 deletions
diff --git a/src/map/config/Data/Const.h b/src/map/config/Data/Const.h index 498e05c17..88b00ea21 100644 --- a/src/map/config/Data/Const.h +++ b/src/map/config/Data/Const.h @@ -39,6 +39,15 @@ #endif /** + * Path within the /db folder to (non-)renewal specific db files + **/ +#if REMODE +#define DBPATH "re/" +#else +#define DBPATH "pre-re/" +#endif + +/** * End of File **/ #endif diff --git a/src/map/homunculus.c b/src/map/homunculus.c index d196ea566..e77b5d093 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -1070,11 +1070,7 @@ void read_homunculus_expdb(void) char line[1024]; int i, j=0; char *filename[]={ -#if REMODE - "re/exp_homun.txt", -#else - "pre-re/exp_homun.txt", -#endif + DBPATH"exp_homun.txt", "exp_homun2.txt"}; memset(hexptbl,0,sizeof(hexptbl)); diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 8da198c59..03de87081 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -567,11 +567,7 @@ static void itemdb_read_itemgroup_sub(const char* filename) static void itemdb_read_itemgroup(void) { char path[256]; -#if REMODE - snprintf(path, 255, "%s/re/item_group_db.txt", db_path); -#else - snprintf(path, 255, "%s/pre-re/item_group_db.txt", db_path); -#endif + snprintf(path, 255, "%s/"DBPATH"item_group_db.txt", db_path); memset(&itemgroup_db, 0, sizeof(itemgroup_db)); itemdb_read_itemgroup_sub(path); ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n", "item_group_db.txt"); @@ -870,11 +866,7 @@ static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scr static int itemdb_readdb(void) { const char* filename[] = { -#if REMODE - "re/item_db.txt", -#else - "pre-re/item_db.txt", -#endif + DBPATH"item_db.txt", "item_db2.txt" }; int fi; @@ -1045,11 +1037,7 @@ static void itemdb_read(void) itemdb_read_itemgroup(); sv_readdb(db_path, "item_avail.txt", ',', 2, 2, -1, &itemdb_read_itemavail); sv_readdb(db_path, "item_noequip.txt", ',', 2, 2, -1, &itemdb_read_noequip); -#if REMODE - sv_readdb(db_path, "re/item_trade.txt", ',', 3, 3, -1, &itemdb_read_itemtrade); -#else - sv_readdb(db_path, "pre-re/item_trade.txt", ',', 3, 3, -1, &itemdb_read_itemtrade); -#endif + sv_readdb(db_path, DBPATH"item_trade.txt", ',', 3, 3, -1, &itemdb_read_itemtrade); sv_readdb(db_path, "item_delay.txt", ',', 2, 2, MAX_ITEMDELAYS, &itemdb_read_itemdelay); sv_readdb(db_path, "item_buyingstore.txt", ',', 1, 1, -1, &itemdb_read_buyingstore); } diff --git a/src/map/mob.c b/src/map/mob.c index e1c324ba1..82e75c9db 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3730,11 +3730,7 @@ static bool mob_readdb_sub(char* fields[], int columns, int current) static void mob_readdb(void) { const char* filename[] = { -#if REMODE - "re/mob_db.txt", -#else - "pre-re/mob_db.txt", -#endif + DBPATH"mob_db.txt", "mob_db2.txt" }; int fi; @@ -3861,15 +3857,9 @@ static int mob_read_randommonster(void) char *str[10],*p; int i,j; const char* mobfile[] = { -#if REMODE - "re/mob_branch.txt", - "mob_poring.txt", - "re/mob_boss.txt", -#else - "pre-re/mob_branch.txt", + DBPATH"mob_branch.txt", "mob_poring.txt", - "pre-re/mob_boss.txt", -#endif + DBPATH"mob_boss.txt", "mob_pouch.txt"}; memset(&summon, 0, sizeof(summon)); @@ -4304,11 +4294,7 @@ static bool mob_parse_row_mobskilldb(char** str, int columns, int current) *------------------------------------------*/ static void mob_readskilldb(void) { const char* filename[] = { -#if REMODE - "re/mob_skill_db.txt", -#else - "pre-re/mob_skill_db.txt", -#endif + DBPATH"mob_skill_db.txt", "mob_skill_db2.txt" }; int fi; diff --git a/src/map/pc.c b/src/map/pc.c index e4554ac72..bea0b2941 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -8451,11 +8451,9 @@ int pc_readdb(void) // 必要??値?み?み memset(exp_table,0,sizeof(exp_table)); memset(max_level,0,sizeof(max_level)); -#if REMODE - sprintf(line, "%s/re/exp.txt", db_path); -#else - sprintf(line, "%s/pre-re/exp.txt", db_path); -#endif + + sprintf(line, "%s/"DBPATH"exp.txt", db_path); + fp=fopen(line, "r"); if(fp==NULL){ ShowError("can't read %s\n", line); @@ -8537,22 +8535,17 @@ int pc_readdb(void) // スキルツリ? memset(skill_tree,0,sizeof(skill_tree)); -#if REMODE - sv_readdb(db_path, "re/skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree); -#else - sv_readdb(db_path, "pre-re/skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree); -#endif + + sv_readdb(db_path, DBPATH"skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree); // ?性修正テ?ブル for(i=0;i<4;i++) for(j=0;j<ELE_MAX;j++) for(k=0;k<ELE_MAX;k++) attr_fix_table[i][j][k]=100; -#if REMODE - sprintf(line, "%s/re/attr_fix.txt", db_path); -#else - sprintf(line, "%s/pre-re/attr_fix.txt", db_path); -#endif + + sprintf(line, "%s/"DBPATH"attr_fix.txt", db_path); + fp=fopen(line,"r"); if(fp==NULL){ ShowError("can't read %s\n", line); @@ -8600,11 +8593,8 @@ int pc_readdb(void) // スキルツリ? memset(statp,0,sizeof(statp)); i=1; -#if REMODE - sprintf(line, "%s/re/statpoint.txt", db_path); -#else - sprintf(line, "%s/pre-re/statpoint.txt", db_path); -#endif + + sprintf(line, "%s/"DBPATH"statpoint.txt", db_path); fp=fopen(line,"r"); if(fp == NULL){ ShowWarning("Can't read '"CL_WHITE"%s"CL_RESET"'... Generating DB.\n",line); diff --git a/src/map/skill.c b/src/map/skill.c index f9e59659d..4ec69ac49 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -15715,19 +15715,12 @@ static void skill_readdb(void) // load skill databases safestrncpy(skill_db[0].name, "UNKNOWN_SKILL", sizeof(skill_db[0].name)); safestrncpy(skill_db[0].desc, "Unknown Skill", sizeof(skill_db[0].desc)); -#if REMODE - sv_readdb(db_path, "re/skill_db.txt" , ',', 17, 17, MAX_SKILL_DB, skill_parse_row_skilldb); - sv_readdb(db_path, "re/skill_require_db.txt" , ',', 32, 32, MAX_SKILL_DB, skill_parse_row_requiredb); - sv_readdb(db_path, "re/skill_cast_db.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb); - sv_readdb(db_path, "re/skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb); - sv_readdb(db_path, "re/skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb); -#else - sv_readdb(db_path, "pre-re/skill_db.txt" , ',', 17, 17, MAX_SKILL_DB, skill_parse_row_skilldb); - sv_readdb(db_path, "pre-re/skill_require_db.txt" , ',', 32, 32, MAX_SKILL_DB, skill_parse_row_requiredb); - sv_readdb(db_path, "pre-re/skill_cast_db.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb); - sv_readdb(db_path, "pre-re/skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb); - sv_readdb(db_path, "pre-re/skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb); -#endif + + sv_readdb(db_path, DBPATH"skill_db.txt" , ',', 17, 17, MAX_SKILL_DB, skill_parse_row_skilldb); + sv_readdb(db_path, DBPATH"skill_require_db.txt" , ',', 32, 32, MAX_SKILL_DB, skill_parse_row_requiredb); + sv_readdb(db_path, DBPATH"skill_cast_db.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb); + sv_readdb(db_path, DBPATH"skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb); + sv_readdb(db_path, DBPATH"skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb); sv_readdb(db_path, "skill_nocast_db.txt" , ',', 2, 2, MAX_SKILL_DB, skill_parse_row_nocastdb); diff --git a/src/map/status.c b/src/map/status.c index d6c180e7d..8fdfdb6a5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -10169,12 +10169,9 @@ int status_readdb(void) sv_readdb(db_path, "job_db2.txt", ',', 1, 1+MAX_LEVEL, -1, &status_readdb_job2); sv_readdb(db_path, "size_fix.txt", ',', MAX_WEAPON_TYPE, MAX_WEAPON_TYPE, ARRAYLENGTH(atkmods), &status_readdb_sizefix); #if REMODE - sv_readdb(db_path, "re/refine_db.txt", ',', 3+MAX_REFINE+1, 3+MAX_REFINE+1, ARRAYLENGTH(percentrefinery), &status_readdb_refine); - sv_readdb(db_path, "re/job_db_extra.txt", ',', 1+RE_JOB_DB_MAX, 1+RE_JOB_DB_MAX, -1, &status_readdb_job_re); -#else - sv_readdb(db_path, "pre-re/refine_db.txt", ',', 3+MAX_REFINE+1, 3+MAX_REFINE+1, ARRAYLENGTH(percentrefinery), &status_readdb_refine); + sv_readdb(db_path, DBPATH"job_db_extra.txt", ',', 1+RE_JOB_DB_MAX, 1+RE_JOB_DB_MAX, -1, &status_readdb_job_re); #endif - + sv_readdb(db_path, DBPATH"refine_db.txt", ',', 3+MAX_REFINE+1, 3+MAX_REFINE+1, ARRAYLENGTH(percentrefinery), &status_readdb_refine); return 0; } |