From 7052b8a95aaff5a92b3d478b45dee1b66d0f3cbf Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Sun, 25 Apr 2021 01:51:42 +0200 Subject: [PATCH] Fixed reloading of statusdb (#5893) Fixes #5879 Thanks to @mazvi --- src/map/atcommand.cpp | 2 +- src/map/status.cpp | 12 ++++++++---- src/map/status.hpp | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 7004d9a8ae..f2506fe012 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -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(); diff --git a/src/map/status.cpp b/src/map/status.cpp index 42d60180d1..d23ba0d77a 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -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; } diff --git a/src/map/status.hpp b/src/map/status.hpp index 91cb78f7d1..23ef0f3444 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -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);