소스 검색

Fixed an issue with fake NPCs (#5554)

Correctly removing the state tracking of fake NPC usage in case the player was detached before the script ended.

Fixes #5379

Thanks to @blipblopblip and @Patotron
Lemongrass3110 4 년 전
부모
커밋
f97dd6e85f
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/map/script.cpp

+ 5 - 0
src/map/script.cpp

@@ -4309,6 +4309,11 @@ static void script_detach_state(struct script_state* st, bool dequeue_event)
 	struct map_session_data* sd;
 
 	if(st->rid && (sd = map_id2sd(st->rid))!=NULL) {
+		if( sd->state.using_fake_npc ){
+			clif_clearunit_single( sd->npc_id, CLR_OUTSIGHT, sd->fd );
+			sd->state.using_fake_npc = 0;
+		}
+
 		sd->st = st->bk_st;
 		sd->npc_id = st->bk_npcid;
 		sd->state.disable_atcommand_on_npc = 0;