diff options
author | shennetsind <ind@henn.et> | 2015-01-17 18:49:03 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2015-01-17 18:49:03 -0200 |
commit | 3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a (patch) | |
tree | 2f646d420976e459ef585debfca2ae55d3185528 /src/map/unit.c | |
parent | 348044f12d5f683c8945e0eac642f2795050fb4e (diff) | |
download | hercules-3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a.tar.gz hercules-3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a.tar.bz2 hercules-3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a.tar.xz hercules-3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a.zip |
Another ~10 Fixes
Addressing out of bounds read/write.
Special Thanks to 4144 and Haruna!
Signed-off-by: shennetsind <ind@henn.et>
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 7f41f4709..a6edef408 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1971,8 +1971,8 @@ bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, if (map->getcell(tbl->m,tbl->x-dx,tbl->y-dy,CELL_CHKNOPASS)) { //Look for a suitable cell to place in. - for(i=0;i<9 && map->getcell(tbl->m,tbl->x-dirx[i],tbl->y-diry[i],CELL_CHKNOPASS);i++); - if (i==9) return false; //No valid cells. + for(i=0;i<8 && map->getcell(tbl->m,tbl->x-dirx[i],tbl->y-diry[i],CELL_CHKNOPASS);i++); + if (i==8) return false; //No valid cells. dx = dirx[i]; dy = diry[i]; } |