Fixed memory leak when using loadnpc or reloadnpcfile command (#5667)

Fixes #5649
This commit is contained in:
CairoLee 2021-01-04 04:41:57 +08:00 committed by GitHub
parent dfa1df7de6
commit 01188b1501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -4752,7 +4752,7 @@ ACMD_FUNC(loadnpc)
npc_read_event_script();
ShowStatus( "NPC file '" CL_WHITE "%s" CL_RESET "' was reloaded.\n", message );
ShowStatus( "NPC file '" CL_WHITE "%s" CL_RESET "' was loaded.\n", message );
npc_event_doall_path( script_config.init_event_name, message );
clif_displaymessage(fd, msg_txt(sd,262)); // Script loaded.

View File

@ -581,6 +581,7 @@ int npc_event_doall_path( const char* event_name, const char* path ){
ShowStatus( "Event '" CL_WHITE "%s" CL_RESET "' executed with '" CL_WHITE "%d" CL_RESET "' NPCs.\n", event_name, count );
mapit_free(iter);
return count;
}