Merge pull request #1169 from CharonInferar/Fixes

Fixed KBT #65, 182 and AI-related commandService bug
This commit is contained in:
CharonInferar
2014-08-16 21:48:07 +02:00
5 changed files with 31 additions and 26 deletions
+7 -5
View File
@@ -80,8 +80,9 @@ public class CommandService implements INetworkDispatch {
if (actor == null)
return false;
if (actor.getClient() == null)
return false;
// if (actor.getClient() == null)
// return false;
// Please consider that AI is calling callCommand too. Thank you.
if (command == null)
return false;
@@ -95,6 +96,7 @@ public class CommandService implements INetworkDispatch {
if (actor.hasCooldown(command.getCooldownGroup()) || actor.hasCooldown(command.getCommandName()))
return false;
// Causes this service method to return with false after equipping a rifle, not allowing to unequip it anymore
// because the client seems to consider rifles invalidweapons for an unkown reason
@@ -115,7 +117,7 @@ public class CommandService implements INetworkDispatch {
return false;
}
}
switch (command.getTargetType()) {
case 0: // Target Not Used For This Command
break;
@@ -251,7 +253,7 @@ public class CommandService implements INetworkDispatch {
default:
break;
}
switch (command.getTarget()) {
case 0: // Ally Only
if (target == null) {
@@ -318,7 +320,7 @@ public class CommandService implements INetworkDispatch {
e.printStackTrace();
}
}
if(command instanceof CombatCommand) {
try {
processCommand(actor, target, (BaseSWGCommand) command.clone(), actionCounter, commandArgs);