summaryrefslogtreecommitdiff
path: root/src/map/pc.h
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-06 18:47:11 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-06 18:47:11 +0000
commitf0fa9794bcdde0b1402bb7a7256265f59bbd7313 (patch)
tree7b63a598956cf1c3acf681c13112f5d6c4278e93 /src/map/pc.h
parentb1b0860d1ca7e0f9ddb57756be9af11d9557d555 (diff)
downloadhercules-f0fa9794bcdde0b1402bb7a7256265f59bbd7313.tar.gz
hercules-f0fa9794bcdde0b1402bb7a7256265f59bbd7313.tar.bz2
hercules-f0fa9794bcdde0b1402bb7a7256265f59bbd7313.tar.xz
hercules-f0fa9794bcdde0b1402bb7a7256265f59bbd7313.zip
- Added EQP_/EQI_ constants in pc.h to identify equip position and equip indexes, makes equipping related code much easier to read.
- Also cleaned up pc_equipitem. When dual wielding or equipping accessories, if the client actually specifies one of the two positions, it will be taken into account. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7550 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.h')
-rw-r--r--src/map/pc.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/map/pc.h b/src/map/pc.h
index 94613d114..6cfb9f532 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -40,6 +40,43 @@ enum {
MAX_WEAPON_TYPE
} weapon_type;
+//Equip position constants
+enum {
+ EQP_HEAD_LOW = 0x0001,
+ EQP_HEAD_MID = 0x0200, //512
+ EQP_HEAD_TOP = 0x0100, //256
+ EQP_HAND_R = 0x0002,
+ EQP_HAND_L = 0x0020, //32
+ EQP_ARMOR = 0x0010, //16
+ EQP_SHOES = 0x0040, //64
+ EQP_GARMENT = 0x0004,
+ EQP_ACC_L = 0x0008,
+ EQP_ACC_R = 0x0080, //128
+ EQP_AMMO = 0x8000, //32768
+} equip_pos_enum;
+
+#define EQP_WEAPON (EQP_HAND_R|EQP_HAND_L)
+#define EQP_SHIELD EQP_HAND_L
+#define EQP_HELM (EQP_HEAD_LOW|EQP_HEAD_MID|EQP_HEAD_TOP)
+#define EQP_ACC (EQP_ACC_L|EQP_ACC_R)
+
+//Equip indexes constants. (eg: sd->equip_index[EQI_AMMO] returns the index
+//where the arrows are equipped)
+enum {
+ EQI_ACC_L = 0,
+ EQI_ACC_R,
+ EQI_SHOES,
+ EQI_GARMENT,
+ EQI_HEAD_LOW,
+ EQI_HEAD_MID,
+ EQI_HEAD_TOP,
+ EQI_ARMOR,
+ EQI_HAND_L,
+ EQI_HAND_R,
+ EQI_AMMO,
+ EQI_MAX
+} equip_index_enum;
+
#define pc_setdead(sd) ((sd)->state.dead_sit = (sd)->vd.dead_sit = 1)
#define pc_setsit(sd) ((sd)->state.dead_sit = (sd)->vd.dead_sit = 2)
#define pc_isdead(sd) ((sd)->state.dead_sit == 1)