summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-18 00:30:28 -0300
committershennetsind <ind@henn.et>2013-02-18 00:30:28 -0300
commit7e72f0cee8867837be53cb2119b610b00e9bd587 (patch)
tree22ab404109fb2def22cf0085fcec2bf174210970 /src/map/pet.c
parent237d76e7c409251b5fdb9f3eee40ef3fe5dc2b25 (diff)
downloadhercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.gz
hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.bz2
hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.xz
hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.zip
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 <ind@henn.et>
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c6
1 files changed, 2 insertions, 4 deletions
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<retrycount;i++){