Updated Shield Spell behavior (#3290)

* Fixes #3236.
* Shield Spell is now canceled when the user switches shields.
Thanks to @EthernalFriend and @MrLekkz!
This commit is contained in:
Aleos 2018-07-06 13:30:38 -04:00 committed by GitHub
parent 6b148d5c35
commit d612788ed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10044,6 +10044,9 @@ bool pc_unequipitem(struct map_session_data *sd, int n, int flag) {
status_change_end(&sd->bl, SC_DANCING, INVALID_TIMER); // Unequipping => stop dancing.
}
if(sd->inventory.u.items_inventory[n].equip & EQP_HAND_L) {
if (sd->status.shield && battle_getcurrentskill(&sd->bl) == LG_SHIELDSPELL)
unit_skillcastcancel(&sd->bl, 0); // Cancel Shield Spell if player swaps shields.
sd->status.shield = sd->weapontype2 = 0;
pc_calcweapontype(sd);
clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);