aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/items/item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pegasus/items/item.cpp')
-rw-r--r--engines/pegasus/items/item.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/engines/pegasus/items/item.cpp b/engines/pegasus/items/item.cpp
index 8089f2b93d..830d3f2f34 100644
--- a/engines/pegasus/items/item.cpp
+++ b/engines/pegasus/items/item.cpp
@@ -39,9 +39,9 @@
namespace Pegasus {
Item::Item(const ItemID id, const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction) : IDObject(id) {
- _itemNeighborhood = neighborhood;
- _itemRoom = room;
- _itemDirection = direction;
+ _originalNeighborhood = _itemNeighborhood = neighborhood;
+ _originalRoom = _itemRoom = room;
+ _originalDirection = _itemDirection = direction;
_itemWeight = 1;
_itemOwnerID = kNoActorID;
_itemState = 0;
@@ -131,6 +131,14 @@ Item::~Item() {
delete[] _itemExtras.entries;
}
+void Item::reset() {
+ _itemNeighborhood = _originalNeighborhood;
+ _itemRoom = _originalRoom;
+ _itemDirection = _originalDirection;
+ _itemOwnerID = kNoActorID;
+ _itemState = 0;
+}
+
void Item::writeToStream(Common::WriteStream *stream) {
stream->writeUint16BE(_itemNeighborhood);
stream->writeUint16BE(_itemRoom);