return result;
}
-void has_immune_cold(player_type *creature_ptr)
+BIT_FLAGS has_immune_cold(player_type *creature_ptr)
{
- object_type *o_ptr;
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- creature_ptr->immune_cold = FALSE;
- if (creature_ptr->ele_immune) {
+ BIT_FLAGS result = 0L;
+
+ if (creature_ptr->ele_immune) {
if (creature_ptr->special_defense & DEFENSE_COLD)
- creature_ptr->immune_cold = TRUE;
+ result |= FLAG_CAUSE_MAGIC_TIME_EFFECT;
}
- for (inventory_slot_type i = INVEN_RARM; i < INVEN_TOTAL; i++) {
- o_ptr = &creature_ptr->inventory_list[i];
- if (!o_ptr->k_idx)
- continue;
-
- object_flags(creature_ptr, o_ptr, flgs);
- if (has_flag(flgs, TR_IM_COLD))
- creature_ptr->immune_cold = TRUE;
- }
+ result |= check_equipment_flags(creature_ptr, TR_IM_COLD);
+ return result;
}
bool has_right_hand_weapon(player_type *creature_ptr)
BIT_FLAGS has_immune_acid(player_type *creature_ptr);
BIT_FLAGS has_immune_elec(player_type *creature_ptr);
BIT_FLAGS has_immune_fire(player_type *creature_ptr);
-void has_immune_cold(player_type *creature_ptr);
+BIT_FLAGS has_immune_cold(player_type *creature_ptr);
bool has_right_hand_weapon(player_type *creature_ptr);
bool has_left_hand_weapon(player_type *creature_ptr);
bool has_two_handed_weapons(player_type *creature_ptr);
creature_ptr->immune_acid = has_immune_acid(creature_ptr);
creature_ptr->immune_elec = has_immune_elec(creature_ptr);
creature_ptr->immune_fire = has_immune_fire(creature_ptr);
- has_immune_cold(creature_ptr);
+ creature_ptr->immune_cold = has_immune_cold(creature_ptr);
has_resist_acid(creature_ptr);
has_resist_elec(creature_ptr);
has_resist_fire(creature_ptr);
BIT_FLAGS immune_acid; /* Immunity to acid */
BIT_FLAGS immune_elec; /* Immunity to lightning */
BIT_FLAGS immune_fire; /* Immunity to fire */
- bool immune_cold; /* Immunity to cold */
+ BIT_FLAGS immune_cold; /* Immunity to cold */
bool resist_acid; /* Resist acid */
bool resist_elec; /* Resist lightning */