diff --git a/src/main/java/org/bitbiome/commands/UseCommand.java b/src/main/java/org/bitbiome/commands/UseCommand.java index 5da2190..633fc22 100644 --- a/src/main/java/org/bitbiome/commands/UseCommand.java +++ b/src/main/java/org/bitbiome/commands/UseCommand.java @@ -12,22 +12,23 @@ private boolean combat = false; @Override public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine engine) { - getEnemies(engine.getPlayer().getLocation().getMobList()); + Player player = engine.getPlayer(); + getEnemies(player.getLocation().getMobList()); System.out.println(getUseMessage(message.split(" ", 2)[1], engine)); while(enemies.size() > 0 && combat) { - if(engine.getPlayer().getHp() <= 0) + if(player.getHp() <= 0) System.exit(0); for(int i = 0; i