summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorDennis Friis <peavey@placid.dk>2008-11-06 16:46:18 +0000
committerDennis Friis <peavey@placid.dk>2008-11-06 16:46:18 +0000
commit87f43f7621dda3071ba189df6975cd0a0595165a (patch)
treefa5cf0603bbcc4ecb4506dd357124975a8534503 /src/localplayer.cpp
parent9475a009e95a3f379a0e97bc66d1aab93ca24b34 (diff)
downloadmana-87f43f7621dda3071ba189df6975cd0a0595165a.tar.gz
mana-87f43f7621dda3071ba189df6975cd0a0595165a.tar.bz2
mana-87f43f7621dda3071ba189df6975cd0a0595165a.tar.xz
mana-87f43f7621dda3071ba189df6975cd0a0595165a.zip
Have equipment tied into player inventory instead of keeping its own list of pointers to items. This ensures the ressource is up-to-date and avoids crashes on stale item pointers.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 3caa5ead..bb91711c 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -144,7 +144,7 @@ void LocalPlayer::unequipItem(Item *item)
outMsg.writeInt16(item->getInvIndex());
// Tidy equipment directly to avoid weapon still shown bug, for instance
- mEquipment->removeEquipment(item);
+ mEquipment->removeEquipment(item->getInvIndex());
}
void LocalPlayer::useItem(Item *item)