summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-11-02 19:30:00 +0300
committerAndrei Karas <akaras@inbox.ru>2017-11-04 23:24:24 +0300
commitff898b1d949aac48c9017e89d5f7ba5e18d65870 (patch)
tree1dd52678af736ede65b36b165b2032bac10b2954 /src/map/npc.c
parent497a25b19d58ace8e450614f0b6cab433a040428 (diff)
downloadhercules-ff898b1d949aac48c9017e89d5f7ba5e18d65870.tar.gz
hercules-ff898b1d949aac48c9017e89d5f7ba5e18d65870.tar.bz2
hercules-ff898b1d949aac48c9017e89d5f7ba5e18d65870.tar.xz
hercules-ff898b1d949aac48c9017e89d5f7ba5e18d65870.zip
Refresh npc after changing fields in setunitdata.
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index c9edb2595..0702b2525 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3659,6 +3659,18 @@ void npc_setclass(struct npc_data* nd, short class_) {
clif->spawn(&nd->bl);// fade in
}
+void npc_refresh(struct npc_data* nd)
+{
+ nullpo_retv(nd);
+
+ if (map->list[nd->bl.m].users) {
+ // using here CLR_TRICKDEAD because other flags show effects.
+ // probably need use other flag or other way to refresh npc.
+ clif->clearunit_area(&nd->bl, CLR_TRICKDEAD); // fade out
+ clif->spawn(&nd->bl); // fade in
+ }
+}
+
// @commands (script based)
int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const char* message, const char* eventname)
{
@@ -5196,4 +5208,5 @@ void npc_defaults(void) {
npc->market_delfromsql = npc_market_delfromsql;
npc->market_delfromsql_sub = npc_market_delfromsql_sub;
npc->db_checkid = npc_db_checkid;
+ npc->refresh = npc_refresh;
}