aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/equip.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/equip.cpp
parentc17df7d3e28e0eeb21f7a62d1c66f525b487a5fa (diff)
more fixes
Diffstat (limited to 'frontend/cmd/equip.cpp')
-rw-r--r--frontend/cmd/equip.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/frontend/cmd/equip.cpp b/frontend/cmd/equip.cpp
index 8f37c0c..72795a8 100644
--- a/frontend/cmd/equip.cpp
+++ b/frontend/cmd/equip.cpp
@@ -15,23 +15,7 @@ void GameController::cmd_equip(string & target_name) {
throw Exception("object \"%s\" niet gevonden", target_name.c_str());
Object & object = **it;
-
- try {
- WeaponObject & weapon = dynamic_cast<WeaponObject &>(object);
- player.inventory.remove(&weapon);
- player.equip(&weapon);
- this->dungeon->update();
- return;
- } catch (std::bad_cast &) {};
-
- try {
- ArmorObject & armor = dynamic_cast<ArmorObject &>(object);
- player.inventory.remove(&armor);
- player.equip(&armor);
- this->dungeon->update();
- return;
- } catch (std::bad_cast &) {};
-
- throw Exception("object \"%s\" is niet draagbaar", target_name.c_str());
+ player.equip(&object);
+ this->dungeon->update();
}