Browse Source

Fixed a possible crash

Follow up to 1e2032c

Thanks to @Everade
Lemongrass3110 7 years ago
parent
commit
ecbab96403
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/map/skill.cpp

+ 1 - 1
src/map/skill.cpp

@@ -6518,7 +6518,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 		if(!clif_skill_nodamage(src,bl,skill_id,skill_lv, sc_start(src,bl,type,(60+skill_lv*10),skill_lv, skill_get_time(skill_id,skill_lv)))) {
 		if(!clif_skill_nodamage(src,bl,skill_id,skill_lv, sc_start(src,bl,type,(60+skill_lv*10),skill_lv, skill_get_time(skill_id,skill_lv)))) {
 			if (dstsd){
 			if (dstsd){
 				short index = dstsd->equip_index[EQI_HAND_R];
 				short index = dstsd->equip_index[EQI_HAND_R];
-				if (index&EQP_WEAPON && dstsd->inventory_data[index]->type == IT_WEAPON)
+				if (index != -1 && dstsd->inventory_data[index] && dstsd->inventory_data[index]->type == IT_WEAPON)
 					pc_unequipitem(dstsd, index, 3); //Must unequip the weapon instead of breaking it [Daegaladh]
 					pc_unequipitem(dstsd, index, 3); //Must unequip the weapon instead of breaking it [Daegaladh]
 			}
 			}
 			if (sd)
 			if (sd)