summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-30 15:29:17 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-30 15:29:17 +0000
commita1fddcf716995eddf1c26e1395c8cc24ce6b3eba (patch)
tree81c5947a93a0b58b2d684a2d9589cec4c68f1673 /src/map/pet.c
parent6f704b3e087d36513e4c5b190da10141231fb187 (diff)
downloadhercules-a1fddcf716995eddf1c26e1395c8cc24ce6b3eba.tar.gz
hercules-a1fddcf716995eddf1c26e1395c8cc24ce6b3eba.tar.bz2
hercules-a1fddcf716995eddf1c26e1395c8cc24ce6b3eba.tar.xz
hercules-a1fddcf716995eddf1c26e1395c8cc24ce6b3eba.zip
- Small optimization in battle_check_target
- Disabled ontouch npcs triggering on hidden/chase-walk characters. - Added the SC* code blocks relevant to SC_AVOID, SC_CHANGE, SC_BLOODLUST, SC_FLEET - Added structure status_data to homun_data - Added handling of BL_HOMUNCULUS in status_heal, status_damage. - Cleaned up the homun-submitted code, moved the relevant code to status_calc_homunculus. - Updated map-server Makefile to compile mercenary.* files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6847 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 39e16ea70..2b349daff 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -893,13 +893,14 @@ static int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, uns
return 0;
}
- if (!check_distance_bl(&sd->bl, &pd->bl, pd->db->range2) && DIFF_TICK(tick, pd->ud.canmove_tick) > 0) {
+ if (!check_distance_bl(&sd->bl, &pd->bl, pd->db->range2)) {
//Master too far, chase.
if(pd->target_id)
pet_unlocktarget(pd);
if(pd->ud.walktimer != -1 && pd->ud.target == sd->bl.id)
return 0; //Already walking to him
-
+ if (DIFF_TICK(tick, pd->ud.canmove_tick) < 0)
+ return 0; //Can't move yet.
pd->status.speed = (sd->battle_status.speed>>1);
if(pd->status.speed <= 0)
pd->status.speed = 1;