diff options
author | Haru <haru@dotalux.com> | 2016-01-08 15:54:35 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-01-08 15:54:35 +0100 |
commit | 3d90889ad1c4e53bf8b61e478fc83f123076422b (patch) | |
tree | 2844fd1a8e8a9a6fea4a842b9a300ac9c8ee8adf /src/map/skill.c | |
parent | e3da170660e8c52ec5657c086057085ef20e382f (diff) | |
download | hercules-3d90889ad1c4e53bf8b61e478fc83f123076422b.tar.gz hercules-3d90889ad1c4e53bf8b61e478fc83f123076422b.tar.bz2 hercules-3d90889ad1c4e53bf8b61e478fc83f123076422b.tar.xz hercules-3d90889ad1c4e53bf8b61e478fc83f123076422b.zip |
Cleaned up the pilebunker item check
- Follow-up to e3da170660e8c52ec5657c086057085ef20e382f
- Removed redundant checks for sd->equip_index[EQI_HAND_R] validity
- Added itemid_is_pilebunker macro
- Restored correct indentation of the return instruction
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index f9a2d0e34..d4d70d115 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -13764,13 +13764,11 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id } break; case NC_PILEBUNKER: - if ((sd->equip_index[EQI_HAND_R] >= 0 && sd->status.inventory[sd->equip_index[EQI_HAND_R]].nameid == ITEMID_PILEBUNCKER) || - (sd->equip_index[EQI_HAND_R] >= 0 && sd->status.inventory[sd->equip_index[EQI_HAND_R]].nameid == ITEMID_PILEBUNCKER_S) || - (sd->equip_index[EQI_HAND_R] >= 0 && sd->status.inventory[sd->equip_index[EQI_HAND_R]].nameid == ITEMID_PILEBUNCKER_P) || - (sd->equip_index[EQI_HAND_R] >= 0 && sd->status.inventory[sd->equip_index[EQI_HAND_R]].nameid == ITEMID_PILEBUNCKER_T)); - else { + if (sd->equip_index[EQI_HAND_R] < 0 + || !itemid_is_pilebunker(sd->status.inventory[sd->equip_index[EQI_HAND_R]].nameid) + ) { clif->skill_fail(sd, skill_id, USESKILL_FAIL_THIS_WEAPON, 0); - return 0; + return 0; } break; case NC_HOVERING: |