mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Fix crash with Master Warcraft
This commit is contained in:
@@ -457,8 +457,12 @@ public class ComputerUtilCombat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int threshold = (((PlayerControllerAi) ai.getController()).getAi().getIntProperty(AiProps.AI_IN_DANGER_THRESHOLD));
|
int threshold = 0;
|
||||||
int maxTreshold = (((PlayerControllerAi) ai.getController()).getAi().getIntProperty(AiProps.AI_IN_DANGER_MAX_THRESHOLD)) - threshold;
|
int maxTreshold = 0;
|
||||||
|
if (ai.getController().isAI()) {
|
||||||
|
threshold = ((PlayerControllerAi) ai.getController()).getAi().getIntProperty(AiProps.AI_IN_DANGER_THRESHOLD);
|
||||||
|
maxTreshold = ((PlayerControllerAi) ai.getController()).getAi().getIntProperty(AiProps.AI_IN_DANGER_MAX_THRESHOLD) - threshold;
|
||||||
|
}
|
||||||
|
|
||||||
int chance = MyRandom.getRandom().nextInt(80) + 5;
|
int chance = MyRandom.getRandom().nextInt(80) + 5;
|
||||||
while (maxTreshold > 0) {
|
while (maxTreshold > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user