summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-21 19:09:58 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-23 23:36:19 +0300
commitad0dfc94fb7cd3c2f4099821b4b49153165a579f (patch)
treed86261dd02bd434166f8ebf23511926b7d84deeb /src/map/unit.c
parent4e681ce12a3f9574c33dc1e11ca8665e8f04e8a0 (diff)
downloadhercules-ad0dfc94fb7cd3c2f4099821b4b49153165a579f.tar.gz
hercules-ad0dfc94fb7cd3c2f4099821b4b49153165a579f.tar.bz2
hercules-ad0dfc94fb7cd3c2f4099821b4b49153165a579f.tar.xz
hercules-ad0dfc94fb7cd3c2f4099821b4b49153165a579f.zip
Add battle config option check_occupied_cells.
If set check_occupied_cells to 0 it will allow walk to occupied cells And it heavy reduce CPU usage on walking.
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index b8e84492b..2e96e9c20 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -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