Skip to content

Commit be705b1

Browse files
authored
Treat own wolves as allies (#1489)
* Fix wolf not ally * Consider own wolf as ally as well * Remove redundant check * Fix isAlly method to cast target correctly
1 parent aaa7243 commit be705b1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/studio/magemonkey/fabled/data/Settings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,8 @@ public boolean canAttack(LivingEntity attacker, LivingEntity target, EntityDamag
995995
* @return true if an ally, false otherwise
996996
*/
997997
public boolean isAlly(LivingEntity attacker, LivingEntity target) {
998-
return !canAttack(attacker, target);
998+
return !canAttack(attacker, target) || (target instanceof Wolf && ((Wolf) target).isTamed()
999+
&& (attacker.equals(((Wolf) target).getOwner())));
9991000
}
10001001

10011002
/**

0 commit comments

Comments
 (0)