diff options
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r-- | src/actions/commands.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index c879916a1..25be294a0 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -22,6 +22,7 @@ #include "actormanager.h" #include "configuration.h" +#include "emoteshortcut.h" #include "game.h" #include "inventory.h" #include "item.h" @@ -817,4 +818,33 @@ impHandler(homunTalk) return true; } +impHandler(homunEmote) +{ + if (!serverFeatures->haveTalkPet()) + return false; + + if (event.action >= InputAction::HOMUN_EMOTE_1 + && event.action <= InputAction::HOMUN_EMOTE_48) + { + const int emotion = event.action - InputAction::HOMUN_EMOTE_1; + if (emoteShortcut) + homunculusHandler->emote(emoteShortcut->getEmote(emotion)); + if (Game::instance()) + Game::instance()->setValidSpeed(); + return true; + } + + return false; +} + +impHandler(commandHomunEmote) +{ + if (!serverFeatures->haveTalkPet()) + return false; + + homunculusHandler->emote(static_cast<uint8_t>( + atoi(event.args.c_str()))); + return true; +} + } // namespace Actions |