diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-03-11 22:53:36 +0100 |
---|---|---|
committer | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-03-14 22:35:09 +0100 |
commit | 492c7bc03c5a40957677f2d98c7d61961dfa6113 (patch) | |
tree | f74d891cee574088c51d6b53a34114d8c457a8cd | |
parent | 7d70f7ec35b0b4476686b73fc221527a6d1ed0fa (diff) | |
download | hercules-492c7bc03c5a40957677f2d98c7d61961dfa6113.tar.gz hercules-492c7bc03c5a40957677f2d98c7d61961dfa6113.tar.bz2 hercules-492c7bc03c5a40957677f2d98c7d61961dfa6113.tar.xz hercules-492c7bc03c5a40957677f2d98c7d61961dfa6113.zip |
Remove map_session_data->state.abra_flag and use map_session_data->autocast.type instead
-rw-r--r-- | src/map/pc.c | 7 | ||||
-rw-r--r-- | src/map/pc.h | 1 | ||||
-rw-r--r-- | src/map/skill.c | 8 |
3 files changed, 7 insertions, 9 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index b37afab86..3cfe28a11 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5295,9 +5295,10 @@ 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; - // Removes abracadabra/randomize spell flag for delayed consume items or item doesn't get consumed - if (sd->inventory_data[n]->flag.delay_consume) - sd->state.abra_flag = 0; + // 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] diff --git a/src/map/pc.h b/src/map/pc.h index 7e69169f0..a0566fadc 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -206,7 +206,6 @@ struct map_session_data { unsigned int rest : 1; unsigned int storage_flag : 2; // @see enum storage_flag unsigned int snovice_dead_flag : 1; //Explosion spirits on death: 0 off, 1 used. - unsigned int abra_flag : 2; // Abracadabra bugfix by Aru unsigned int autotrade : 2; //By Fantik unsigned int showdelay :1; unsigned int showexp :1; diff --git a/src/map/skill.c b/src/map/skill.c index dfc939c6f..d21a19742 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6334,7 +6334,6 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * sd->autocast.type = AUTOCAST_ABRA; sd->autocast.skill_id = abra_skill_id; sd->autocast.skill_lv = abra_skill_lv; - sd->state.abra_flag = 1; sd->skillitem = abra_skill_id; sd->skillitemlv = abra_skill_lv; clif->item_skill(sd, abra_skill_id, abra_skill_lv); @@ -10079,7 +10078,6 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * sd->autocast.type = AUTOCAST_IMPROVISE; sd->autocast.skill_id = improv_skill_id; sd->autocast.skill_lv = improv_skill_lv; - sd->state.abra_flag = 2; sd->skillitem = improv_skill_id; sd->skillitemlv = improv_skill_lv; clif->item_skill(sd, improv_skill_id, improv_skill_lv); @@ -14118,9 +14116,9 @@ static int skill_check_condition_castbegin(struct map_session_data *sd, uint16 s sc = NULL; if( sd->skillitem == skill_id ) { - if( sd->state.abra_flag ) // Hocus-Pocus was used. [Inkfish] - sd->state.abra_flag = 0; - else { + if (sd->autocast.type == AUTOCAST_ABRA || sd->autocast.type == AUTOCAST_IMPROVISE) { // Abracadabra or Improvised Song was used. + sd->autocast.type = AUTOCAST_NONE; + } else { int i; // When a target was selected, consume items that were skipped in pc_use_item [Skotlex] if( (i = sd->itemindex) == -1 || |