Browse Source

Fixed reloading of statusdb (#5893)

Fixes #5879

Thanks to @mazvi
Lemongrass3110 4 years ago
parent
commit
7052b8a95a
3 changed files with 10 additions and 6 deletions
  1. 1 1
      src/map/atcommand.cpp
  2. 8 4
      src/map/status.cpp
  3. 1 1
      src/map/status.hpp

+ 1 - 1
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();

+ 8 - 4
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;
 }

+ 1 - 1
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);