diff options
Diffstat (limited to 'src/progs/manaverse/actions/commands.cpp')
-rw-r--r-- | src/progs/manaverse/actions/commands.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/progs/manaverse/actions/commands.cpp b/src/progs/manaverse/actions/commands.cpp index 087b96491..668c54b80 100644 --- a/src/progs/manaverse/actions/commands.cpp +++ b/src/progs/manaverse/actions/commands.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,6 +58,7 @@ #include "input/inputactionoperators.h" #include "listeners/inputactionreplaylistener.h" +#include "listeners/inputactionreplayconfirmlistener.h" #include "net/adminhandler.h" #include "net/chathandler.h" @@ -966,7 +967,22 @@ impHandler(setHomunculusName) impHandler0(fireHomunculus) { - if (homunculusHandler != nullptr) + const HomunculusInfo *const info = PlayerInfo::getHomunculus(); + if (info == nullptr) + return false; + + const std::string &args = event.args; + if (args.empty()) + { + inputActionReplayConfirmListener.openDialog( + // TRANSLATORS: dialog title + _("Really?"), + // TRANSLATORS: dialog question + _("Really kill your homunculous? This is irreversible!"), + InputAction::HOMUNCULUS_FIRE); + return true; + } + else if (args == "yes" && homunculusHandler != nullptr) { homunculusHandler->fire(); return true; |