From 7e72f0cee8867837be53cb2119b610b00e9bd587 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Mon, 18 Feb 2013 00:30:28 -0300 Subject: Improvements all over the place Committing on the behalf of mkbu95 who is unable to do it himself, he coded it all and sent me the diff. Thanks mkbu95! Signed-off-by: shennetsind --- src/map/pet.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/map/pet.c') diff --git a/src/map/pet.c b/src/map/pet.c index 5c7f15151..f64012e69 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -100,8 +100,6 @@ int pet_unlocktarget(struct pet_data *pd) *------------------------------------------*/ int pet_attackskill(struct pet_data *pd, int target_id) { - struct block_list *bl; - if (!battle_config.pet_status_support || !pd->a_skill || (battle_config.pet_equip_required && !pd->pet.equip)) return 0; @@ -112,6 +110,7 @@ int pet_attackskill(struct pet_data *pd, int target_id) if (rnd()%100 < (pd->a_skill->rate +pd->pet.intimate*pd->a_skill->bonusrate/1000)) { //Skotlex: Use pet's skill int inf; + struct block_list *bl; bl=map_id2bl(target_id); if(bl == NULL || pd->bl.m != bl->m || bl->prev == NULL || status_isdead(bl) || @@ -779,13 +778,12 @@ static int pet_food(struct map_session_data *sd, struct pet_data *pd) static int pet_randomwalk(struct pet_data *pd,unsigned int tick) { - const int retrycount=20; - nullpo_ret(pd); Assert((pd->msd == 0) || (pd->msd->pd == pd)); if(DIFF_TICK(pd->next_walktime,tick) < 0 && unit_can_move(&pd->bl)) { + const int retrycount=20; int i,x,y,c,d=12-pd->move_fail_count; if(d<5) d=5; for(i=0;i