Equipment cmd checks

This commit is contained in:
Treeku
2014-04-08 05:58:04 +01:00
parent 10e8c40507
commit c7ea253620
+6 -2
View File
@@ -114,11 +114,15 @@ public class CommandService implements INetworkDispatch {
break;
case 1: // Other Only
if (target != null && target == actor) {
if (target == null || target == actor) {
return false;
}
if (target != null && actor.getPosition().getDistance(target.getPosition()) > command.getMaxRangeToTarget()) {
if (target.getContainer() == actor || target.getGrandparent() == actor) {
break;
}
if (actor.getPosition().getDistance(target.getPosition()) > command.getMaxRangeToTarget()) {
return false;
}