summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-23 20:06:22 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-24 22:23:19 +0300
commite28a19cfff1f26457d6a0f6192d6782c8db7d3d2 (patch)
tree3d38e3e827dc8c3d3ed2a5b8b4748ad94b5f5470
parent2b366baf187cbcea5d8004e99cba949c83c67433 (diff)
downloadhercules-e28a19cfff1f26457d6a0f6192d6782c8db7d3d2.tar.gz
hercules-e28a19cfff1f26457d6a0f6192d6782c8db7d3d2.tar.bz2
hercules-e28a19cfff1f26457d6a0f6192d6782c8db7d3d2.tar.xz
hercules-e28a19cfff1f26457d6a0f6192d6782c8db7d3d2.zip
Add missing checks into path.c
-rw-r--r--src/map/path.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/map/path.c b/src/map/path.c
index 0df9708d8..379532681 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -89,6 +89,7 @@ int path_blownpos(struct block_list *bl, int16 m,int16 x0,int16 y0,int16 dx,int1
{
struct map_data *md;
+ Assert_retr(-1, m < 0 || m >= map->count);
if( !map->list[m].cell )
return -1;
md = &map->list[m];
@@ -126,6 +127,8 @@ bool path_search_long(struct shootpath_data *spd,struct block_list *bl,int16 m,i
struct map_data *md;
struct shootpath_data s_spd;
+ Assert_retr(false, m < 0 || m >= map->count);
+
if( spd == NULL )
spd = &s_spd; // use dummy output variable
@@ -258,6 +261,8 @@ bool path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int1
struct map_data *md;
struct walkpath_data s_wpd;
+ Assert_retr(false, m < 0 || m >= map->count);
+
if (wpd == NULL)
wpd = &s_wpd; // use dummy output variable