|
@@ -10155,7 +10155,7 @@ static int pc_read_statsdb(const char *basedir, int last_s, bool silent){
|
|
|
fp=fopen(line,"r");
|
|
|
if(fp == NULL){
|
|
|
if(silent==0) ShowWarning("Can't read '"CL_WHITE"%s"CL_RESET"'... Generating DB.\n",line);
|
|
|
- return -1;
|
|
|
+ return max(last_s,i);
|
|
|
} else {
|
|
|
int entries=0;
|
|
|
while(fgets(line, sizeof(line), fp))
|
|
@@ -10192,7 +10192,7 @@ int pc_readdb(void)
|
|
|
int i, k, s = 1;
|
|
|
const char* dbsubpath[] = {
|
|
|
"",
|
|
|
- "import"
|
|
|
+ "/"DBIMPORT,
|
|
|
//add other path here
|
|
|
};
|
|
|
|
|
@@ -10202,11 +10202,11 @@ int pc_readdb(void)
|
|
|
// Reset and read skilltree
|
|
|
memset(skill_tree,0,sizeof(skill_tree));
|
|
|
sv_readdb(db_path, DBPATH"skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree, 0);
|
|
|
- sv_readdb(db_path, "import/skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree, 1);
|
|
|
+ sv_readdb(db_path, DBIMPORT"/skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree, 1);
|
|
|
|
|
|
#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, "import/level_penalty.txt", ',', 4, 4, -1, &pc_readdb_levelpenalty, 1);
|
|
|
+ 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;
|
|
|
for( j = 0; j < CLASS_ALL; j++ ){
|
|
@@ -10226,19 +10226,25 @@ int pc_readdb(void)
|
|
|
// reset then read statspoint
|
|
|
memset(statp,0,sizeof(statp));
|
|
|
for(i=0; i<ARRAYLENGTH(dbsubpath); i++){
|
|
|
- int n1 = strlen(db_path)+strlen(dbsubpath[i])+1;
|
|
|
- int n2 = strlen(db_path)+strlen(DBPATH)+strlen(dbsubpath[i])+1;
|
|
|
- char* dbsubpath1 = aMalloc(n1+1);
|
|
|
- char* dbsubpath2 = aMalloc(n2+1);
|
|
|
- safesnprintf(dbsubpath1,n1+1,"%s%s",db_path,dbsubpath[i]);
|
|
|
- if(i==0) safesnprintf(dbsubpath2,n2,"%s/%s%s",db_path,DBPATH,dbsubpath[i]);
|
|
|
- else safesnprintf(dbsubpath2,n2,"%s%s",db_path,dbsubpath[i]);
|
|
|
+ uint8 n1 = strlen(db_path)+strlen(dbsubpath[i])+1;
|
|
|
+ uint8 n2 = strlen(db_path)+strlen(DBPATH)+strlen(dbsubpath[i])+1;
|
|
|
+ char* dbsubpath1 = (char*)aMalloc(n1+1);
|
|
|
+ char* dbsubpath2 = (char*)aMalloc(n2+1);
|
|
|
+
|
|
|
+ if(i==0) {
|
|
|
+ safesnprintf(dbsubpath1,n1,"%s%s",db_path,dbsubpath[i]);
|
|
|
+ safesnprintf(dbsubpath2,n2,"%s/%s%s",db_path,DBPATH,dbsubpath[i]);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ safesnprintf(dbsubpath1,n1,"%s%s",db_path,dbsubpath[i]);
|
|
|
+ safesnprintf(dbsubpath2,n1,"%s%s",db_path,dbsubpath[i]);
|
|
|
+ }
|
|
|
|
|
|
s = pc_read_statsdb(dbsubpath2,s,i);
|
|
|
#ifdef RENEWAL_ASPD
|
|
|
- sv_readdb(dbsubpath1, "re/job_db1.txt",',',6+MAX_WEAPON_TYPE,6+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1, i);
|
|
|
+ sv_readdb(dbsubpath2, "job_db1.txt",',',6+MAX_WEAPON_TYPE,6+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1, i);
|
|
|
#else
|
|
|
- sv_readdb(dbsubpath1, "pre-re/job_db1.txt",',',5+MAX_WEAPON_TYPE,5+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1, i);
|
|
|
+ sv_readdb(dbsubpath2, "job_db1.txt",',',5+MAX_WEAPON_TYPE,5+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1, i);
|
|
|
#endif
|
|
|
sv_readdb(dbsubpath1, "job_db2.txt",',',1,1+MAX_LEVEL,CLASS_COUNT,&pc_readdb_job2, i);
|
|
|
sv_readdb(dbsubpath2, "job_exp.txt",',',4,1000+3,CLASS_COUNT*2,&pc_readdb_job_exp, i); //support till 1000lvl
|