aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/hit.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-02 20:57:37 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-02 20:57:37 +0100
commitb4507b3601bedcaa599673b9f9083d1574132157 (patch)
treea25a2f249f3434aa204da2095a26b220de188941 /frontend/cmd/hit.cpp
parentc17df7d3e28e0eeb21f7a62d1c66f525b487a5fa (diff)
more fixes
Diffstat (limited to 'frontend/cmd/hit.cpp')
-rw-r--r--frontend/cmd/hit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/frontend/cmd/hit.cpp b/frontend/cmd/hit.cpp
index cb5c56e..f4a78fd 100644
--- a/frontend/cmd/hit.cpp
+++ b/frontend/cmd/hit.cpp
@@ -19,6 +19,9 @@ void GameController::cmd_hit(string & target_name) {
throw Exception("vijand \"%s\" niet gevonden", target_name.c_str());
Enemy & enemy = **it;
+ if (enemy.is_dead())
+ throw Exception("%s is al dood!", enemy.get_name().c_str());
+
if (rng.rand_double() > player.get_attack()) {
lprtf("Je hebt gemist!\n");
} else {