Don't send success upon failure

This commit is contained in:
shädam 2022-07-07 14:11:33 +02:00 committed by Luke H-W
parent 26b1cad9c9
commit a4a87fe75b

View File

@ -26,10 +26,11 @@ public final class EnterDungeonCommand implements CommandHandler {
} }
boolean result = targetPlayer.getServer().getDungeonManager().enterDungeon(targetPlayer.getSession().getPlayer(), 0, dungeonId); boolean result = targetPlayer.getServer().getDungeonManager().enterDungeon(targetPlayer.getSession().getPlayer(), 0, dungeonId);
CommandHandler.sendMessage(sender, translate(sender, "commands.enter_dungeon.changed", dungeonId));
if (!result) { if (!result) {
CommandHandler.sendMessage(sender, translate(sender, "commands.enter_dungeon.not_found_error")); CommandHandler.sendMessage(sender, translate(sender, "commands.enter_dungeon.not_found_error"));
} else {
CommandHandler.sendMessage(sender, translate(sender, "commands.enter_dungeon.changed", dungeonId));
} }
} catch (Exception e) { } catch (Exception e) {
CommandHandler.sendMessage(sender, translate(sender, "commands.enter_dungeon.usage")); CommandHandler.sendMessage(sender, translate(sender, "commands.enter_dungeon.usage"));