summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-09-12 13:13:23 -0300
committerJesusaves <cpntb1@ymail.com>2020-09-12 13:13:23 -0300
commit1443f47ca63972f737bd9cc0322f77dc416ff2a0 (patch)
tree6b851ced5b878ac8b2b13eeb01e04d598bacfe43 /src/map/npc.c
parentc53f8a099151f2e8c26c0ab36f35d34256c0d6cb (diff)
downloadhercules-1443f47ca63972f737bd9cc0322f77dc416ff2a0.tar.gz
hercules-1443f47ca63972f737bd9cc0322f77dc416ff2a0.tar.bz2
hercules-1443f47ca63972f737bd9cc0322f77dc416ff2a0.tar.xz
hercules-1443f47ca63972f737bd9cc0322f77dc416ff2a0.zip
This is Hercules v2019.09.22
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 1c5c72af9..00207a745 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1258,6 +1258,9 @@ static void run_tomb(struct map_session_data *sd, struct npc_data *nd)
char time[10];
nullpo_retv(nd);
+
+ sd->npc_id = nd->bl.id;
+
strftime(time, sizeof(time), "%H:%M", localtime(&nd->u.tomb.kill_time));
// TODO: Find exact color?
@@ -1349,8 +1352,10 @@ static int npc_scriptcont(struct map_session_data *sd, int id, bool closing)
return 1;
}
- if(id != npc->fake_nd->bl.id) { // Not item script
- if ((npc->checknear(sd,target)) == NULL){
+ if (id != npc->fake_nd->bl.id) { // Not item script
+ if (sd->state.npc_unloaded != 0) {
+ sd->state.npc_unloaded = 0;
+ } else if ((npc->checknear(sd,target)) == NULL) {
ShowWarning("npc_scriptcont: failed npc->checknear test.\n");
return 1;
}
@@ -1371,8 +1376,10 @@ static int npc_scriptcont(struct map_session_data *sd, int id, bool closing)
if( sd->progressbar.npc_id && DIFF_TICK(sd->progressbar.timeout,timer->gettick()) > 0 )
return 1;
- if( !sd->st )
+ if( !sd->st ) {
+ sd->npc_id = 0;
return 1;
+ }
if( closing && sd->st->state == CLOSE )
sd->st->state = END;