diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-23 21:00:16 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-26 17:18:21 +0200 |
commit | e726c34606f85347e70a0deb6b180db03b6d0c25 (patch) | |
tree | e78e5ba07dd9484abed035cc3e63744101bbef57 /src/game-server/buysell.cpp | |
parent | a3f72002fa02cd4c525f101c5f240a22d4480119 (diff) | |
download | manaserv-e726c34606f85347e70a0deb6b180db03b6d0c25.tar.gz manaserv-e726c34606f85347e70a0deb6b180db03b6d0c25.tar.bz2 manaserv-e726c34606f85347e70a0deb6b180db03b6d0c25.tar.xz manaserv-e726c34606f85347e70a0deb6b180db03b6d0c25.zip |
Merged MovingObject into the Being class
Also renamed Object to Actor, to make it sound a little less generic.
Cleans up a bit the rather big hierarchy of different object types we
have.
Diffstat (limited to 'src/game-server/buysell.cpp')
-rw-r--r-- | src/game-server/buysell.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/game-server/buysell.cpp b/src/game-server/buysell.cpp index defc3506..a6b036d6 100644 --- a/src/game-server/buysell.cpp +++ b/src/game-server/buysell.cpp @@ -50,15 +50,17 @@ void BuySell::registerItem(int id, int amount, int cost) if (mSell) { int nb = Inventory(mChar).count(id); - if (nb == 0) return; - if (!amount || nb < amount) amount = nb; + if (nb == 0) + return; + if (!amount || nb < amount) + amount = nb; } TradedItem it = { id, amount, cost }; mItems.push_back(it); } -void BuySell::start(MovingObject *obj) +void BuySell::start(Actor *actor) { if (mItems.empty()) { @@ -67,7 +69,7 @@ void BuySell::start(MovingObject *obj) } MessageOut msg(mSell ? GPMSG_NPC_SELL : GPMSG_NPC_BUY); - msg.writeShort(obj->getPublicID()); + msg.writeShort(actor->getPublicID()); for (TradedItems::const_iterator i = mItems.begin(), i_end = mItems.end(); i != i_end; ++i) { |