diff options
author | shennetsind <shennetsind@users.noreply.github.com> | 2015-02-24 14:44:46 -0300 |
---|---|---|
committer | shennetsind <shennetsind@users.noreply.github.com> | 2015-02-24 14:44:46 -0300 |
commit | 214eec8dc196b0eb8c85e4ae616942bd77075a96 (patch) | |
tree | d86261dd02bd434166f8ebf23511926b7d84deeb /src/map/unit.c | |
parent | 6b949190402e71d5c489f627da79eb5f51669b44 (diff) | |
parent | ad0dfc94fb7cd3c2f4099821b4b49153165a579f (diff) | |
download | hercules-214eec8dc196b0eb8c85e4ae616942bd77075a96.tar.gz hercules-214eec8dc196b0eb8c85e4ae616942bd77075a96.tar.bz2 hercules-214eec8dc196b0eb8c85e4ae616942bd77075a96.tar.xz hercules-214eec8dc196b0eb8c85e4ae616942bd77075a96.zip |
Merge pull request #463 from 4144/cellstack
Improve performance with many mobs in small area
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index 6e4efd533..2e96e9c20 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -454,7 +454,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(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, 1) > 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 @@ -493,7 +493,7 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag) if( ud == NULL) return 0; - if ((flag&8) && !map->closest_freecell(bl->m, &x, &y, BL_CHAR|BL_NPC, 1)) //This might change x and y + if (battle_config.check_occupied_cells && (flag&8) && !map->closest_freecell(bl->m, &x, &y, BL_CHAR|BL_NPC, 1)) //This might change x and y return 0; if (!path->search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS)) // Count walk path cells |