Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-10-26 21:08:12 +0000
committerStijn Buys <ingar@osirion.org>2010-10-26 21:08:12 +0000
commit75c6db097b990e58b4b2585580a89561c838d923 (patch)
tree8c913bdc531ea9a76dcaa9e10a65763f95fa55e4 /src/core/item.cc
parent23c7d2c11170ee8736673e82a88e87a3d2e538f7 (diff)
updated network protocol version to 20, implemented invemtory depletion, unified depletion with keepalive
Diffstat (limited to 'src/core/item.cc')
-rw-r--r--src/core/item.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/item.cc b/src/core/item.cc
index df12885..3768afa 100644
--- a/src/core/item.cc
+++ b/src/core/item.cc
@@ -23,6 +23,7 @@ Item::Item(const Info *info)
{
item_info = info;
item_amount = 0;
+ item_flags = 0;
item_price = info->price();
set_timestamp(game() ? game()->timestamp() : 1);
}
@@ -31,6 +32,7 @@ Item::Item(const Item &other)
{
item_info = other.info();
item_amount = other.amount();
+ item_flags = other.flags();
item_price = other.price();
set_timestamp(game() ? game()->timestamp() : 1);
}
@@ -39,7 +41,8 @@ Item::~Item()
{
item_info = 0;
item_amount = 0;
- item_amount = 0;
+ item_flags = 0;
+ item_price = 0;
}
void Item::set_amount(const long amount)
@@ -73,13 +76,14 @@ void Item::set_timestamp(const unsigned long timestamp)
void Item::serialize_server_update(std::ostream & os) const
{
- os << amount() << " " << price() << " ";
+ os << amount() << " " << price() << " " << flags() << " ";
}
void Item::receive_server_update(std::istream &is)
{
is >> item_amount;
is >> item_price;
+ is >> item_flags;
}
} // namespace core