mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-01-21 10:58:12 +01:00
Do not wait for combat turns when monsters want to move, but cannot find a path.
This commit is contained in:
@@ -359,10 +359,14 @@ public final class CombatController implements VisualEffectCompletedCallback {
|
||||
|
||||
private void moveCurrentMonster() {
|
||||
controllers.actorStatsController.useAPs(currentActiveMonster, currentActiveMonster.getMoveCost());
|
||||
if (controllers.monsterMovementController.findPathFor(currentActiveMonster, world.model.player.position)) {
|
||||
controllers.monsterMovementController.moveMonsterToNextPosition(currentActiveMonster, world.model.currentMap);
|
||||
combatActionListeners.onMonsterMovedDuringCombat(currentActiveMonster);
|
||||
if (!controllers.monsterMovementController.findPathFor(currentActiveMonster, world.model.player.position)) {
|
||||
// Couldn't find a path to move on.
|
||||
handleNextMonsterAction();
|
||||
return;
|
||||
}
|
||||
|
||||
controllers.monsterMovementController.moveMonsterToNextPosition(currentActiveMonster, world.model.currentMap);
|
||||
combatActionListeners.onMonsterMovedDuringCombat(currentActiveMonster);
|
||||
waitForNextMonsterAction();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user