From c5031982d27c0e7e82f7a83d251097158b3c6ac5 Mon Sep 17 00:00:00 2001 From: Atemo Date: Sun, 7 Aug 2022 21:54:53 +0200 Subject: [PATCH] Allow the player to stand on a cell occupied by disabled/hidden npc (#7154) Fixed #7153 --- src/map/map.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/map/map.cpp b/src/map/map.cpp index ade9f9efa5..0644960f36 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -559,6 +559,11 @@ int map_count_oncell(int16 m, int16 x, int16 y, int type, int flag) if (type&~BL_MOB) for( bl = mapdata->block[bx+by*mapdata->bxs] ; bl != NULL ; bl = bl->next ) if(bl->x == x && bl->y == y && bl->type&type) { + if (bl->type == BL_NPC) { // Don't count hidden or invisible npc. Cloaked npc are counted + npc_data *nd = BL_CAST(BL_NPC, bl); + if (nd && (nd->bl.m < 0 || nd->sc.option && nd->sc.option&(OPTION_HIDE|OPTION_INVISIBLE))) + continue; + } if(flag&1) { struct unit_data *ud = unit_bl2ud(bl); if(!ud || ud->walktimer == INVALID_TIMER)