summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2020-05-19 12:25:19 +0300
committerAndrei Karas <akaras@inbox.ru>2020-06-01 01:08:50 +0300
commitb648e49e821760502b5b5ae826b194c98b17d529 (patch)
tree3c75a18b8f79a20a8cbf41003fe15d3bab3f0df4
parent495f4b84f775030e189209704387ee97adb20ee0 (diff)
downloadhercules-b648e49e821760502b5b5ae826b194c98b17d529.tar.gz
hercules-b648e49e821760502b5b5ae826b194c98b17d529.tar.bz2
hercules-b648e49e821760502b5b5ae826b194c98b17d529.tar.xz
hercules-b648e49e821760502b5b5ae826b194c98b17d529.zip
fix motd on load/unload npc.
-rw-r--r--src/map/atcommand.c3
-rw-r--r--src/map/clif.c1
-rw-r--r--src/map/npc.c4
3 files changed, 7 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 54cc9e2c9..76448b237 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -4499,6 +4499,7 @@ ACMD(loadnpc)
// add to list of script sources and run it
npc->addsrcfile(message);
npc->parsesrcfile(message,true);
+ npc->motd = npc->name2id("HerculesMOTD");
npc->read_event_script();
clif->message(fd, msg_fd(fd,262));
@@ -4533,6 +4534,7 @@ ACMD(unloadnpc)
npc->unload_duplicates(nd, (flag != 0));
npc->unload(nd, true, (flag != 0));
+ npc->motd = npc->name2id("HerculesMOTD");
npc->read_event_script();
clif->message(fd, msg_fd(fd, 112)); /// Npc Disabled.
return true;
@@ -4588,6 +4590,7 @@ ACMD(reloadnpc)
clif->message(fd, msg_fd(fd, 1386)); /// File unloaded. Be aware that...
npc->addsrcfile(file_path);
npc->parsesrcfile(file_path, true);
+ npc->motd = npc->name2id("HerculesMOTD");
npc->read_event_script();
clif->message(fd, msg_fd(fd, 262)); /// Script loaded.
return true;
diff --git a/src/map/clif.c b/src/map/clif.c
index 12242e44c..8edb47e61 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -15485,6 +15485,7 @@ static void clif_parse_GMKick(int fd, struct map_session_data *sd)
}
npc->unload_duplicates(nd, true);
npc->unload(nd, true, true);
+ npc->motd = npc->name2id("HerculesMOTD");
npc->read_event_script();
}
break;
diff --git a/src/map/npc.c b/src/map/npc.c
index 2f03623e4..30aeb616a 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -5728,8 +5728,10 @@ static bool npc_unloadfile(const char *filepath, bool unload_mobs)
dbi_destroy(iter);
- if (found) /// Refresh event cache.
+ if (found) { /// Refresh event cache.
+ npc->motd = npc->name2id("HerculesMOTD");
npc->read_event_script();
+ }
return found;
}