diff options
author | Haru <haru@dotalux.com> | 2014-10-25 00:42:05 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-10-25 00:42:05 +0200 |
commit | 3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5 (patch) | |
tree | 91414ec9aad216e7297a700dd9bec8c08d668502 /src/map/unit.c | |
parent | ab3b5bd8d231434d0c3fb4db0d977e96613b4e77 (diff) | |
download | hercules-3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5.tar.gz hercules-3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5.tar.bz2 hercules-3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5.tar.xz hercules-3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5.zip |
Added some missing variable initializations
- The issue was caused by memcmp failing because of garbage in structs
padding.
- Fixes bugreport:8410, special thanks (and credits for the fix) to Garr
http://hercules.ws/board/tracker/issue-8410-autotradeat-issue/
- Also reduced scope of some variables, where appropriate.
- Thanks to Ind.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index a54780e83..e99b9f2a1 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -95,6 +95,8 @@ int unit_walktoxy_sub(struct block_list *bl) ud = unit->bl2ud(bl); if(ud == NULL) return 0; + memset(&wpd, 0, sizeof(wpd)); + if( !path->search(&wpd,bl->m,bl->x,bl->y,ud->to_x,ud->to_y,ud->state.walk_easy,CELL_CHKNOPASS) ) return 0; |