From 4455f3a3dd5fa28ef7fc1d1cf6d2bff723c90b47 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Aug 2014 16:13:27 +0300 Subject: Move chat command /talkpet into actions. --- src/actions/commands.cpp | 11 +++++++++++ src/actions/commands.h | 1 + 2 files changed, 12 insertions(+) (limited to 'src/actions') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index e0514f902..ee04acc65 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -36,6 +36,7 @@ #include "being/playerinfo.h" #include "being/playerrelations.h" +#include "gui/chatconsts.h" #include "gui/dialogsmanager.h" #include "gui/gui.h" #include "gui/popupmanager.h" @@ -663,4 +664,14 @@ impHandler(talkRaw) return true; } +impHandler(talkPet) +{ + // in future probably need add channel detection + if (!localPlayer->getPets().empty()) + Net::getChatHandler()->talkPet(event.args, GENERAL_CHANNEL); + else + Net::getChatHandler()->talk(event.args, GENERAL_CHANNEL); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index db0c6eb5e..eb9ab4575 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -67,6 +67,7 @@ namespace Actions decHandler(enableAway); decHandler(testParticle); decHandler(talkRaw); + decHandler(talkPet); } // namespace Actions #undef decHandler -- cgit v1.2.3-70-g09d2