diff options
author | skyleo <skyleo@skyleo.de> | 2019-09-12 00:33:54 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-03-08 20:56:28 +0100 |
commit | 0817191184bd867836a7fcc30d65305b10964a5f (patch) | |
tree | 913c74483d2a29bb6a27a06affec9d573ec6316f /src/map/pet.c | |
parent | 43bc7911460a53a2ebed4b54d81c473b9e6567b8 (diff) | |
download | hercules-0817191184bd867836a7fcc30d65305b10964a5f.tar.gz hercules-0817191184bd867836a7fcc30d65305b10964a5f.tar.bz2 hercules-0817191184bd867836a7fcc30d65305b10964a5f.tar.xz hercules-0817191184bd867836a7fcc30d65305b10964a5f.zip |
Change returning error-code in unit->walktoxy to obey code-style guidelines
Diffstat (limited to 'src/map/pet.c')
-rw-r--r-- | src/map/pet.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/pet.c b/src/map/pet.c index f20de2650..0537baaa7 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -891,7 +891,8 @@ static int pet_randomwalk(struct pet_data *pd, int64 tick) int r=rnd(); int x=pd->bl.x+r%(d*2+1)-d; int y=pd->bl.y+r/(d*2+1)%(d*2+1)-d; - if(map->getcell (pd->bl.m, &pd->bl, x, y, CELL_CHKPASS) && unit->walktoxy(&pd->bl, x, y, 0)) { + if (map->getcell(pd->bl.m, &pd->bl, x, y, CELL_CHKPASS) != 0 + && unit->walktoxy(&pd->bl, x, y, 0) == 0) { pd->move_fail_count=0; break; } @@ -991,7 +992,7 @@ static int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int return 0; //Already walking to him unit->calc_pos(&pd->bl, sd->bl.x, sd->bl.y, sd->ud.dir); - if(!unit->walktoxy(&pd->bl,pd->ud.to_x,pd->ud.to_y,0)) + if (unit->walktoxy(&pd->bl, pd->ud.to_x, pd->ud.to_y, 0) != 0) pet->randomwalk(pd,tick); return 0; |