summaryrefslogtreecommitdiff
path: root/src/mmo
diff options
context:
space:
mode:
authorHoraK-FDF <horak-fdf@web.de>2023-04-03 01:58:15 +0000
committerLed Mitz <smoothshifter@tuta.io>2023-04-03 01:58:15 +0000
commit7980f4d21956314e284448f7dcedd58f9c23b355 (patch)
treebc70b6afa07bec9943d9ec99176637f5a5c1b14a /src/mmo
parentc65f380f93e845c8abab8b05d80b91c271d01dbe (diff)
downloadtmwa-7980f4d21956314e284448f7dcedd58f9c23b355.tar.gz
tmwa-7980f4d21956314e284448f7dcedd58f9c23b355.tar.bz2
tmwa-7980f4d21956314e284448f7dcedd58f9c23b355.tar.xz
tmwa-7980f4d21956314e284448f7dcedd58f9c23b355.zip
Item mode
Diffstat (limited to 'src/mmo')
-rw-r--r--src/mmo/enums.hpp15
-rw-r--r--src/mmo/extract_enums.hpp3
2 files changed, 18 insertions, 0 deletions
diff --git a/src/mmo/enums.hpp b/src/mmo/enums.hpp
index 2564ec9..12c82ca 100644
--- a/src/mmo/enums.hpp
+++ b/src/mmo/enums.hpp
@@ -107,6 +107,20 @@ enum class ItemLook : uint16_t
COUNT = 17,
};
+namespace e
+{
+enum class ItemMode : uint8_t
+{
+ NONE = 0,
+ NO_DROP = 1,
+ NO_TRADE = 2,
+ NO_SELL_TO_NPC = 4,
+ NO_STORAGE = 8,
+};
+ENUM_BITWISE_OPERATORS(ItemMode)
+}
+using e::ItemMode;
+
enum class SEX : uint8_t
{
FEMALE = 0,
@@ -117,6 +131,7 @@ enum class SEX : uint8_t
NEUTRAL = 3,
__OTHER = 4, // used in ManaPlus only
};
+
inline
char sex_to_char(SEX sex)
{
diff --git a/src/mmo/extract_enums.hpp b/src/mmo/extract_enums.hpp
index 0e8ac4c..14e7b17 100644
--- a/src/mmo/extract_enums.hpp
+++ b/src/mmo/extract_enums.hpp
@@ -35,6 +35,7 @@ enum class EPOS : uint16_t;
enum class Opt1 : uint16_t;
enum class Opt2 : uint16_t;
enum class Opt0 : uint16_t;
+enum class ItemMode : uint8_t;
inline
bool impl_extract(XString str, EPOS *iv) { return extract_as_int(str, iv); }
@@ -44,6 +45,8 @@ inline
bool impl_extract(XString str, Opt2 *iv) { return extract_as_int(str, iv); }
inline
bool impl_extract(XString str, Opt0 *iv) { return extract_as_int(str, iv); }
+inline
+bool impl_extract(XString str, ItemMode *iv) { return extract_as_int(str, iv); }
} // namespace e
enum class ItemLook : uint16_t;