summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/equipment.cpp2
-rw-r--r--src/equipment.h10
-rw-r--r--src/localplayer.cpp1
-rw-r--r--src/net/beinghandler.cpp3
5 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b6f5d94..5e921f9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@
* src/gui/equipmentwindow.cpp, data/graphics/gui/Makefile.am,
data/graphics/images/EquipBackground.png: Moved equipment background to
the gui directory. Changed name to lowercase only.
+ * src/localplayer.cpp, src/equipment.h, src/equipment.cpp: Ensured that
+ equipment is cleared at the same time as the inventory.
+ * src/net/beinghandler.cpp: Fixed position of the cleaning bit for
+ looks, so that it actually fits into network data.
2007-08-08 Josh Langley <joshlangley[at]optusnet.com.au>
diff --git a/src/equipment.cpp b/src/equipment.cpp
index 1dfc7d02..9de8c26e 100644
--- a/src/equipment.cpp
+++ b/src/equipment.cpp
@@ -25,7 +25,7 @@
#include "equipment.h"
-Equipment::Equipment()
+void Equipment::clear()
{
std::fill_n(mEquipment, EQUIPMENT_SIZE, 0);
}
diff --git a/src/equipment.h b/src/equipment.h
index bac5a028..f820dcf0 100644
--- a/src/equipment.h
+++ b/src/equipment.h
@@ -24,8 +24,6 @@
#ifndef _TMW_EQUIPMENT_H_
#define _TMW_EQUIPMENT_H_
-class Item;
-
#define EQUIPMENT_SIZE 11
class Equipment
@@ -34,7 +32,13 @@ class Equipment
/**
* Constructor.
*/
- Equipment();
+ Equipment()
+ { clear(); }
+
+ /**
+ * Clears equipment.
+ */
+ void clear();
/**
* Get equipment at the given slot.
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 23d4c99b..478603b8 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -92,6 +92,7 @@ Being::Type LocalPlayer::getType() const
void LocalPlayer::clearInventory()
{
+ mEquipment->clear();
mInventory->clear();
}
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index 44b1a7af..87972212 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -424,7 +424,8 @@ static void handleLooks(Being *being, MessageIn &msg)
Being::BOTTOMCLOTHES_SPRITE };
int mask = msg.readByte();
- if (mask & (1 << 8))
+
+ if (mask & (1 << 7))
{
// The equipment has to be cleared first.
being->setWeaponById(0);