mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-01 02:16:15 -04:00
More command service improvements
This commit is contained in:
@@ -88,10 +88,6 @@ public class CommandService implements INetworkDispatch {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target != null && actor.getPosition().getDistance(target.getPosition) > command.getMaxRangeToTarget()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WeaponObject weapon = (WeaponObject) core.objectService.getObject(actor.getWeaponId());
|
||||
|
||||
if (weapon != null && weapon.getWeaponType() == command.getInvalidWeapon()) {
|
||||
@@ -182,6 +178,10 @@ public class CommandService implements INetworkDispatch {
|
||||
break;
|
||||
}
|
||||
|
||||
if (target != null && actor.getPosition().getDistance(target.getPosition) > command.getMaxRangeToTarget()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (command.shouldCallOnTarget()) {
|
||||
if (target == null || !(target instanceof CreatureObject)) {
|
||||
return false;
|
||||
@@ -468,7 +468,7 @@ public class CommandService implements INetworkDispatch {
|
||||
|
||||
SWGObject target = core.objectService.getObject(commandEnqueue.getTargetID());
|
||||
|
||||
if (!callCommand(actor, command, target, commandEnqueue.getActionCounter(), commandEnqueue.getCommandArguments())) {
|
||||
if (!callCommand(actor, target, command, commandEnqueue.getActionCounter(), commandEnqueue.getCommandArguments())) {
|
||||
// Call failScriptHook
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user