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/path.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/path.c')
-rw-r--r-- | src/map/path.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/map/path.c b/src/map/path.c index a7315da3c..600dfc082 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -255,6 +255,12 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x // Check destination cell if (x1 < 0 || x1 >= md->xs || y1 < 0 || y1 >= md->ys || md->getcellp(md,x1,y1,cell)) return false; + + if( x0 == x1 && y0 == y1 ) { + wpd->path_len = 0; + wpd->path_pos = 0; + return true; + } if (flag&1) { // Try finding direct path to target |