summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-12 17:22:36 +0100
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-14 22:35:10 +0100
commit7c6e21a9057b07929b55de23ae67299434edb6db (patch)
treed78974b3df59dd264b6795b5604097ac33e1a67f /src
parent44581f9de0df3ab18b719e55f793dc22bd2fcb72 (diff)
downloadhercules-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')
-rw-r--r--src/map/pc.c5
-rw-r--r--src/map/skill.c19
2 files changed, 0 insertions, 24 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index e181b5f89..5d87d017d 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5295,11 +5295,6 @@ static int pc_useitem(struct map_session_data *sd, int n)
if(sd->catch_target_class != -1) //Abort pet catching.
sd->catch_target_class = -1;
- // Unset auto-cast related data for items of type IT_DELAYCONSUME or the item won't be consumed.
- // TODO: Check if this is still required. [Kenpachi]
- if (sd->inventory_data[n]->flag.delay_consume != 0)
- sd->autocast.type = AUTOCAST_NONE;
-
amount = sd->status.inventory[n].amount;
//Check if the item is to be consumed immediately [Skotlex]
if (sd->inventory_data[n]->flag.delay_consume || sd->inventory_data[n]->flag.keepafteruse)
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;