summaryrefslogtreecommitdiff
path: root/src/game-server/buysell.cpp
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-04-11 11:10:47 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-04-12 14:56:28 +0200
commit9e6a0f98ecb52e04ab5afce817cb1d7fe2076450 (patch)
tree97b6ffedbfbaf09389fe05c1d183471a97740ebb /src/game-server/buysell.cpp
parentd7fa7ea64f6bb0bc0b097e4bf1ceb4bd9620d0da (diff)
downloadmanaserv-9e6a0f98ecb52e04ab5afce817cb1d7fe2076450.tar.gz
manaserv-9e6a0f98ecb52e04ab5afce817cb1d7fe2076450.tar.bz2
manaserv-9e6a0f98ecb52e04ab5afce817cb1d7fe2076450.tar.xz
manaserv-9e6a0f98ecb52e04ab5afce817cb1d7fe2076450.zip
Moved Actor into an Component
This was the final step to remove the hierachy with Entity on the top.
Diffstat (limited to 'src/game-server/buysell.cpp')
-rw-r--r--src/game-server/buysell.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game-server/buysell.cpp b/src/game-server/buysell.cpp
index 3ba29ef6..cc209ccf 100644
--- a/src/game-server/buysell.cpp
+++ b/src/game-server/buysell.cpp
@@ -30,7 +30,7 @@
#include <algorithm>
-BuySell::BuySell(Actor *c, bool sell):
+BuySell::BuySell(Entity *c, bool sell):
mCurrencyId(ATTR_GP), mChar(c), mSell(sell)
{
c->getComponent<CharacterComponent>()->setBuySell(this);
@@ -94,7 +94,8 @@ int BuySell::registerPlayerItems()
else
{
LOG_WARN("registerPlayersItems(): The character Id: "
- << mChar->getPublicID() << " has unknown items (Id: " << id
+ << mChar->getComponent<ActorComponent>()->getPublicID()
+ << " has unknown items (Id: " << id
<< "). They have been ignored.");
continue;
}
@@ -129,7 +130,7 @@ int BuySell::registerPlayerItems()
return nbItemsToSell;
}
-bool BuySell::start(Actor *actor)
+bool BuySell::start(Entity *actor)
{
if (mItems.empty())
{
@@ -138,7 +139,7 @@ bool BuySell::start(Actor *actor)
}
MessageOut msg(mSell ? GPMSG_NPC_SELL : GPMSG_NPC_BUY);
- msg.writeInt16(actor->getPublicID());
+ msg.writeInt16(actor->getComponent<ActorComponent>()->getPublicID());
for (TradedItems::const_iterator i = mItems.begin(),
i_end = mItems.end(); i != i_end; ++i)
{