summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-26 15:05:48 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-26 15:05:48 +0300
commitb44ae759ff5a848b7c6d15dc80bba4e7a6948575 (patch)
tree17a577d75124c622fb00b516c95f15cc350b374a /src/actions
parentce0c0778675908f7be557b1c115de3eabb828079 (diff)
downloadplus-b44ae759ff5a848b7c6d15dc80bba4e7a6948575.tar.gz
plus-b44ae759ff5a848b7c6d15dc80bba4e7a6948575.tar.bz2
plus-b44ae759ff5a848b7c6d15dc80bba4e7a6948575.tar.xz
plus-b44ae759ff5a848b7c6d15dc80bba4e7a6948575.zip
Move chat command /trade into actions.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp19
-rw-r--r--src/actions/actions.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 251204df4..9d1279e3f 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -596,4 +596,23 @@ impHandler0(cleanFonts)
return true;
}
+impHandler(trade)
+{
+ if (!actorManager)
+ return false;
+
+ const Being *being = actorManager->findBeingByName(
+ event.args, ActorType::PLAYER);
+ if (!being)
+ being = localPlayer->getTarget();
+ if (being)
+ {
+ Net::getTradeHandler()->request(being);
+ tradePartnerName = being->getName();
+ if (tradeWindow)
+ tradeWindow->clear();
+ }
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 92d293df4..ea9faadab 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -60,6 +60,7 @@ namespace Actions
decHandler(cleanGraphics);
decHandler(cleanFonts);
decHandler(attackHuman);
+ decHandler(trade);
} // namespace Actions
#undef decHandler