summaryrefslogtreecommitdiff
path: root/src/map/skill.c
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/skill.c
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/skill.c')
-rw-r--r--src/map/skill.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index b87575768..8f16288c4 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1609,20 +1609,20 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in
if (!where) //Nothing to break.
return 0;
if (sd) {
- for (i = 0; i < 11; i++) {
+ for (i = 0; i < EQI_MAX; i++) {
j = sd->equip_index[i];
if (j <= 0 || sd->status.inventory[j].attribute == 1 || !sd->inventory_data[j])
continue;
flag = 0;
switch(i) {
- case 6: //Upper Head
+ case EQI_HEAD_TOP: //Upper Head
flag = (where&EQP_HELM);
break;
- case 7: //Body
+ case EQI_ARMOR: //Body
flag = (where&EQP_ARMOR);
break;
- case 8: //Left/Right hands
- case 9:
+ case EQI_HAND_R: //Left/Right hands
+ case EQI_HAND_L:
flag = (
(where&EQP_WEAPON && sd->inventory_data[j]->type == 4) ||
(where&EQP_SHIELD && sd->inventory_data[j]->type == 5));