瀏覽代碼

Updated Shield Spell behavior (#3290)

* Fixes #3236.
* Shield Spell is now canceled when the user switches shields.
Thanks to @EthernalFriend and @MrLekkz!
Aleos 6 年之前
父節點
當前提交
d612788ed7
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/map/pc.cpp

+ 3 - 0
src/map/pc.cpp

@@ -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.
 			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->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;
 		sd->status.shield = sd->weapontype2 = 0;
 		pc_calcweapontype(sd);
 		pc_calcweapontype(sd);
 		clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
 		clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);