From ca8e7b4d7621570ee770dd6114eab9986f13accd Mon Sep 17 00:00:00 2001 From: shennetsind Date: Wed, 4 Jan 2012 18:05:41 +0000 Subject: Re-designed /db/ folder structure as previously discussed. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15390 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/itemdb.c | 17 ++++++++++------- src/map/map.c | 6 ++++++ src/map/mob.c | 27 ++++++++++++++++----------- src/map/pc.c | 13 +++++-------- src/map/skill.c | 24 ++++++++++++++---------- src/map/status.c | 8 +++++--- 6 files changed, 56 insertions(+), 39 deletions(-) (limited to 'src/map') diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 48532dd60..972d351a5 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -566,8 +566,11 @@ static void itemdb_read_itemgroup_sub(const char* filename) static void itemdb_read_itemgroup(void) { char path[256]; - snprintf(path, 255, "%s/item_group_db.txt", db_path); - +#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 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"); @@ -867,14 +870,14 @@ static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scr *------------------------------------------*/ static int itemdb_readdb(void) { - /** - * ro-resources inheritance: item_db -> item_db_re -> item_db2 (user customs) - **/ + const char* filename[] = { #if REMODE - const char* filename[] = { "item_db.txt","item_db_re.txt","item_db2.txt" }; + "re/item_db.txt", #else - const char* filename[] = { "item_db.txt","item_db2.txt" }; + "pre-re/item_db.txt", #endif + "item_db2.txt" }; + int fi; for( fi = 0; fi < ARRAYLENGTH(filename); ++fi ) diff --git a/src/map/map.c b/src/map/map.c index 8f7f7efb2..c433857ec 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3717,6 +3717,12 @@ int do_init(int argc, char *argv[]) } map_config_read(MAP_CONF_NAME); +#if REMODE + /** + * to make pre-re conflict safe + **/ + map_config_read("npc/scripts_renewal.conf"); +#endif chrif_checkdefaultlogin(); if (!map_ip_set || !char_ip_set) { diff --git a/src/map/mob.c b/src/map/mob.c index d76f1eac6..427b0ae5f 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3679,11 +3679,13 @@ static bool mob_readdb_sub(char* fields[], int columns, int current) static void mob_readdb(void) { + const char* filename[] = { #if REMODE - const char* filename[] = { "mob_db.txt", "mob_db_re.txt" , "mob_db2.txt" }; + "re/mob_db.txt", #else - const char* filename[] = { "mob_db.txt" , "mob_db2.txt" }; + "pre-re/mob_db.txt", #endif + "mob_db2.txt" }; int fi; for( fi = 0; fi < ARRAYLENGTH(filename); ++fi ) @@ -3812,9 +3814,14 @@ static int mob_read_randommonster(void) int i,j; const char* mobfile[] = { - "mob_branch.txt", +#if REMODE + "re/mob_branch.txt", + "re/mob_boss.txt", +#else + "pre-re/mob_branch.txt", + "pre-re/mob_boss.txt", +#endif "mob_poring.txt", - "mob_boss.txt", "mob_pouch.txt"}; memset(&summon, 0, sizeof(summon)); @@ -4247,16 +4254,14 @@ static bool mob_parse_row_mobskilldb(char** str, int columns, int current) /*========================================== * mob_skill_db.txt reading *------------------------------------------*/ -static void mob_readskilldb(void) -{ - /** - * Due to the way mob_skill_db is made entries cannot be overriden, only stacked, so this is the only case we use a full db file on renewal - **/ +static void mob_readskilldb(void) { + const char* filename[] = { #if REMODE - const char* filename[] = { "mob_skill_db_re.txt", "mob_skill_db2.txt" }; + "re/mob_skill_db.txt", #else - const char* filename[] = { "mob_skill_db.txt", "mob_skill_db2.txt" }; + "pre-re/mob_skill_db.txt", #endif + "mob_skill_db2.txt" }; int fi; if( battle_config.mob_skill_rate == 0 ) diff --git a/src/map/pc.c b/src/map/pc.c index 9d0868c19..0a7d1c901 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -8249,9 +8249,9 @@ int pc_readdb(void) for(k=0;k