summaryrefslogtreecommitdiff
path: root/src/map/pc.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-12-03 03:41:08 +0100
committerHaru <haru@dotalux.com>2017-09-17 17:48:15 +0200
commita681d759cc887e8adccbd30d3b7a7ca355bbda96 (patch)
treecdea2ed4340cd81f31d05e34772ad0d2cf7ffd57 /src/map/pc.h
parent9a7536d2e092d9a7737e795094e68e6d1f94f6e9 (diff)
downloadhercules-a681d759cc887e8adccbd30d3b7a7ca355bbda96.tar.gz
hercules-a681d759cc887e8adccbd30d3b7a7ca355bbda96.tar.bz2
hercules-a681d759cc887e8adccbd30d3b7a7ca355bbda96.tar.xz
hercules-a681d759cc887e8adccbd30d3b7a7ca355bbda96.zip
Differentiate variables that hold a ViewSprite and a weapon Subtype
`sd->status.weapon` is renamed to `sd->status.look.weapon` and only holds ViewSprite IDs. Its previous other meaning is now transferred to `sd->weapontype` (holding the currently equipped weapon type, considering both hands at once) Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.h')
-rw-r--r--src/map/pc.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/map/pc.h b/src/map/pc.h
index c94ec6099..62129b5ae 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -308,7 +308,9 @@ struct map_session_data {
short nameid;
int64 tick;
} item_delay[MAX_ITEMDELAYS]; // [Paradox924X]
- short weapontype1,weapontype2;
+ int16 weapontype; ///< Weapon type considering both hands (@see enum weapon_type).
+ int16 weapontype1; ///< Weapon type in the right/primary hand (@see enum weapon_type).
+ int16 weapontype2; ///< Weapon type in the left/secondary hand (@see enum weapon_type).
short disguise; // [Valaris]
struct weapon_data right_weapon, left_weapon;
@@ -685,8 +687,13 @@ END_ZEROED_BLOCK;
#define pc_stop_attack(sd) (unit->stop_attack(&(sd)->bl))
//Weapon check considering dual wielding.
-#define pc_check_weapontype(sd, type) ((type)&((sd)->status.weapon < MAX_SINGLE_WEAPON_TYPE? \
- 1<<(sd)->status.weapon:(1<<(sd)->weapontype1)|(1<<(sd)->weapontype2)|(1<<(sd)->status.weapon)))
+#define pc_check_weapontype(sd, type) ( \
+ (type) & ( \
+ (sd)->weapontype < MAX_SINGLE_WEAPON_TYPE ? \
+ 1 << (sd)->weapontype : \
+ (1 << (sd)->weapontype1) | (1 << (sd)->weapontype2) \
+ ) \
+ )
// clientside display macros (values to the left/right of the "+")
#ifdef RENEWAL