if(attacking.enemy && tile >= 2 || objectinway) {
return false;
trytowalkto.enemy;
} else {
return true;
}
if(rangeattacking.enemy || magettacking.enemy && tile >= 6 || objectinway) {
return false;
trytowalkto.enemy;
} else {
return true;
}
you would need a check for rangeable objects for the above