diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-03-12 17:22:36 +0100 |
---|---|---|
committer | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-03-14 22:35:10 +0100 |
commit | 7c6e21a9057b07929b55de23ae67299434edb6db (patch) | |
tree | d78974b3df59dd264b6795b5604097ac33e1a67f /src/map/skill.c | |
parent | 44581f9de0df3ab18b719e55f793dc22bd2fcb72 (diff) | |
download | hercules-7c6e21a9057b07929b55de23ae67299434edb6db.tar.gz hercules-7c6e21a9057b07929b55de23ae67299434edb6db.tar.bz2 hercules-7c6e21a9057b07929b55de23ae67299434edb6db.tar.xz hercules-7c6e21a9057b07929b55de23ae67299434edb6db.zip |
Remove IT_DELAYCONSUME related auto-cast code
First of all: In official servers, skill casting item are consumed immediately and thus IT_DELAYCONSUME should not be used for those items
And additionally these code blocks are obsolete, because of the way how skill casting items work.
* If the item won't check the skill's requirements, the code block to delete the item of type IT_DELAYCONSUME isn't even executed.
* If the item does check the skill's requirements, the check is done prior to the skill casting which would be the same as using IT_USABLE.
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 6fc1b80a2..e779e9859 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -14095,25 +14095,6 @@ static int skill_check_condition_castbegin(struct map_session_data *sd, uint16 s if( !sc->count ) sc = NULL; - // TODO: Check if the validation of delayed consume is still required. (See the delayed consume related TODO in pc_useitem().) - if (sd->autocast.type == AUTOCAST_ITEM) { - int i = sd->itemindex; - - if (i == INDEX_NOT_FOUND || sd->status.inventory[i].nameid != sd->itemid || sd->inventory_data[i] == NULL - || sd->status.inventory[i].amount < 1) { // Something went wrong. Item exploit? - sd->itemid = INDEX_NOT_FOUND; - sd->itemindex = INDEX_NOT_FOUND; - return 0; - } - - // Consume the item. Rental usable items are not consumed until expiration. - if (sd->status.inventory[i].expire_time == 0 && sd->inventory_data[i]->flag.delay_consume == 1) - pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME); - - sd->itemid = INDEX_NOT_FOUND; - sd->itemindex = INDEX_NOT_FOUND; - } - if (pc_is90overweight(sd) && sd->autocast.type != AUTOCAST_ITEM) { // Skill casting items ignore the overweight restriction. clif->skill_fail(sd, skill_id, USESKILL_FAIL_WEIGHTOVER, 0, 0); return 0; |