Browse Source

- Small fix in the pet_ai

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5918 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 years ago
parent
commit
bec5bce06d
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/map/pet.c

+ 4 - 1
src/map/pet.c

@@ -977,9 +977,12 @@ static int pet_ai_sub_hard(struct pet_data *pd,unsigned int tick)
 	
 	if (pd->target_id) {
 		target= map_id2bl(pd->target_id);
-		if (!target || pd->bl.m != target->m || target->prev == NULL ||
+		if (!target || pd->bl.m != target->m || status_isdead(target) ||
 			!check_distance_bl(&pd->bl, target, pd->db->range3))
+		{
+			target = NULL;
 			pet_unlocktarget(pd);
+		}
 	}
 	
 	// ƒyƒbƒg‚É‚æ‚郋�[ƒg