From 3f978c02ec2550714a60e6180ecb60e9e779b364 Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 15 May 2017 01:17:03 +0200 Subject: Ignore hidden units in the cell stack limit checks - This improves the Dancer Quest experience as well as other cases of hidden NPCs blocking off certain cells - Fixes #1135 Signed-off-by: Haru --- src/map/map.c | 5 +++++ src/map/mob.c | 2 +- src/map/unit.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/map.c b/src/map/map.c index f8aebcfa6..ff5c2aafd 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -447,6 +447,11 @@ int map_count_oncell(int16 m, int16 x, int16 y, int type, int flag) { struct status_change *sc = status->get_sc(bl); if (sc && (sc->option&OPTION_INVISIBLE)) continue; + if (bl->type == BL_NPC) { + const struct npc_data *nd = BL_UCCAST(BL_NPC, bl); + if (nd->class_ == FAKE_NPC || nd->class_ == HIDDEN_WARP_CLASS) + continue; + } } if (flag&0x1) { struct unit_data *ud = unit->bl2ud(bl); diff --git a/src/map/mob.c b/src/map/mob.c index 98f8865a9..1fb46283d 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1354,7 +1354,7 @@ int mob_unlocktarget(struct mob_data *md, int64 tick) { md->ud.target_to = 0; unit->set_target(&md->ud, 0); } - if(battle_config.official_cell_stack_limit && map->count_oncell(md->bl.m, md->bl.x, md->bl.y, BL_CHAR|BL_NPC, 1) > battle_config.official_cell_stack_limit) { + if(battle_config.official_cell_stack_limit && map->count_oncell(md->bl.m, md->bl.x, md->bl.y, BL_CHAR|BL_NPC, 0x1 | 0x2) > battle_config.official_cell_stack_limit) { unit->walktoxy(&md->bl, md->bl.x, md->bl.y, 8); } diff --git a/src/map/unit.c b/src/map/unit.c index 00c78054b..0b5b21caf 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -474,7 +474,7 @@ int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) ud->to_x = bl->x; ud->to_y = bl->y; - if(battle_config.official_cell_stack_limit && map->count_oncell(bl->m, x, y, BL_CHAR|BL_NPC, 1) > battle_config.official_cell_stack_limit) { + if (battle_config.official_cell_stack_limit && map->count_oncell(bl->m, x, y, BL_CHAR|BL_NPC, 0x1 | 0x2) > battle_config.official_cell_stack_limit) { //Walked on occupied cell, call unit_walktoxy again if(ud->steptimer != INVALID_TIMER) { //Execute step timer on next step instead -- cgit v1.2.3-60-g2f50