Fixed reloading of statusdb (#5893)

Fixes #5879

Thanks to @mazvi
This commit is contained in:
Lemongrass3110 2021-04-25 01:51:42 +02:00 committed by GitHub
parent dc4d20ca52
commit 7052b8a95a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -4016,7 +4016,7 @@ ACMD_FUNC(reload) {
}
clif_displaymessage(fd, msg_txt(sd,255)); // Battle configuration has been reloaded.
} else if (strstr(command, "statusdb") || strncmp(message, "statusdb", 3) == 0) {
status_readdb();
status_readdb( true );
clif_displaymessage(fd, msg_txt(sd,256)); // Status database has been reloaded.
} else if (strstr(command, "pcdb") || strncmp(message, "pcdb", 2) == 0) {
pc_readdb();

View File

@ -15983,8 +15983,7 @@ static bool status_readdb_attrfix(const char *basedir,bool silent)
* refine_db.txt: Refining data table
* @return 0
*/
int status_readdb(void)
{
int status_readdb( bool reload ){
int i, j, k;
const char* dbsubpath[] = {
"",
@ -16025,8 +16024,13 @@ int status_readdb(void)
aFree(dbsubpath2);
}
size_fix_db.load();
refine_db.load();
if( reload ){
size_fix_db.reload();
refine_db.reload();
}else{
size_fix_db.load();
refine_db.load();
}
return 0;
}

View File

@ -2842,7 +2842,7 @@ unsigned short status_base_matk_max(struct block_list *bl, const struct status_d
unsigned short status_base_atk(const struct block_list *bl, const struct status_data *status, int level);
void initChangeTables(void);
int status_readdb(void);
int status_readdb( bool reload = false );
int do_init_status(void);
void do_final_status(void);