diff options
author | Stijn Buys <ingar@osirion.org> | 2012-12-04 21:41:39 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-12-04 21:41:39 +0000 |
commit | a3450f23b09e8d5c66f710fbaf085d6d3b6d8122 (patch) | |
tree | d457d3ed06cc8fe9c128540f26dc702ddd415a2a | |
parent | 9d8aa462f1f66f4ea2cfb07b0b0fff4daa68203c (diff) |
Set item timestamp when flags are set or unset.
-rw-r--r-- | src/core/item.cc | 18 | ||||
-rw-r--r-- | src/core/item.h | 12 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/core/item.cc b/src/core/item.cc index b6e5bd8..9191687 100644 --- a/src/core/item.cc +++ b/src/core/item.cc @@ -49,6 +49,24 @@ void Item::set_id(const unsigned int id) item_id = id; } +void Item::set_flags(const unsigned int flags) +{ + item_flags = flags; + set_timestamp(game() ? game()->timestamp() : 1); +} + +void Item::set_flag(Flags flag) +{ + item_flags |= flag; + set_timestamp(game() ? game()->timestamp() : 1); +} + +void Item::unset_flag(Flags flag) +{ + item_flags &= ~flag; + set_timestamp(game() ? game()->timestamp() : 1); +} + void Item::set_amount(const long amount) { item_amount = amount; diff --git a/src/core/item.h b/src/core/item.h index ae6a158..6388838 100644 --- a/src/core/item.h +++ b/src/core/item.h @@ -138,23 +138,17 @@ public: /** * @brief set all item flags */ - inline void set_flags(const unsigned int flags) { - item_flags = flags; - } + void set_flags(const unsigned int flags); /** * @brief set item flag */ - inline void set_flag(Flags flag) { - item_flags |= flag; - } + void set_flag(Flags flag); /** * @brief unset item flag */ - inline void unset_flag(Flags flag) { - item_flags &= ~flag; - } + void unset_flag(Flags flag); /** * @brief set the dirty flag |