summaryrefslogtreecommitdiff
path: root/src/net/tmwa/playerhandler.cpp
diff options
context:
space:
mode:
authorremoitnane <remoit(DOT)nane(AT)gmail(DOT)com>2010-07-07 03:59:33 -0700
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-07-08 22:33:31 +0200
commit27efdd9a80c7d068f27db8725c2315fee3e10303 (patch)
tree2699a54961f6c29249c9d48747b8938b2d99dbd1 /src/net/tmwa/playerhandler.cpp
parentf1cab9c5ab1d36586ae1e0d1dae3f3d1483522b5 (diff)
downloadmana-27efdd9a80c7d068f27db8725c2315fee3e10303.tar.gz
mana-27efdd9a80c7d068f27db8725c2315fee3e10303.tar.bz2
mana-27efdd9a80c7d068f27db8725c2315fee3e10303.tar.xz
mana-27efdd9a80c7d068f27db8725c2315fee3e10303.zip
Fix crash in picking up an item that no longer exists
Adds ActorSpriteListener to manage ActorSprite destruction as recommended by Jaxad0127. This likewise includes the changes made by Bertram. Reviewed-by: Jaxad0127, Bertram. Resolves: Manasource Mantis #160
Diffstat (limited to 'src/net/tmwa/playerhandler.cpp')
-rw-r--r--src/net/tmwa/playerhandler.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 26c7e922..735da082 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -582,8 +582,11 @@ void PlayerHandler::increaseSkill(int skillId)
void PlayerHandler::pickUp(FloorItem *floorItem)
{
- MessageOut outMsg(CMSG_ITEM_PICKUP);
- outMsg.writeInt32(floorItem->getId());
+ if (floorItem)
+ {
+ MessageOut outMsg(CMSG_ITEM_PICKUP);
+ outMsg.writeInt32(floorItem->getId());
+ }
}
void PlayerHandler::setDirection(char direction)