int idx = is_autopick(player_ptr, o_ptr);
auto_inscribe_item(player_ptr, o_ptr, idx);
bool is_auto_pickup = idx >= 0;
- is_auto_pickup &= autopick_list[idx].action & (DO_AUTOPICK | DO_QUERY_AUTOPICK);
+ is_auto_pickup &= (autopick_list[idx].action & (DO_AUTOPICK | DO_QUERY_AUTOPICK)) != 0;
if (!is_auto_pickup)
{
auto_destroy_item(player_ptr, o_ptr, idx);
Term_erase(0, i + 1, tb->wid);
}
- bool is_updated = tb->old_cy != tb->cy || (tb->dirty_flags & (DIRTY_ALL | DIRTY_NOT_FOUND | DIRTY_NO_SEARCH)) || tb->dirty_line == tb->cy;
+ bool is_dirty_diary = (tb->dirty_flags & (DIRTY_ALL | DIRTY_NOT_FOUND | DIRTY_NO_SEARCH)) != 0;
+ bool is_updated = tb->old_cy != tb->cy || is_dirty_diary || tb->dirty_line == tb->cy;
if (is_updated) return;
autopick_type an_entry, *entry = &an_entry;
int bonus = attacker_ptr->to_h_m + (attacker_ptr->lev * 6 / 5);
int chance = (attacker_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
- bool is_hit = !(r_ptr->flags2 & RF2_QUANTUM) || !randint0(2);
+ bool is_hit = ((r_ptr->flags2 & RF2_QUANTUM) == 0) || !randint0(2);
is_hit &= test_hit_norm(attacker_ptr, chance, r_ptr->ac, m_ptr->ml);
if (!is_hit)
{
bool is_empty_or_dark = dun->empty_level;
is_empty_or_dark &= !one_in_(DARK_EMPTY) || (randint1(100) > floor_ptr->dun_level);
- is_empty_or_dark &= !(dungeon_ptr->flags1 & DF1_DARKNESS);
+ is_empty_or_dark &= (dungeon_ptr->flags1 & DF1_DARKNESS) == 0;
if (!is_empty_or_dark) return TRUE;
/* Lite the floor_ptr->grid_array */
bool can_place_door = randint0(100) < dun_tun_jct;
can_place_door &= possible_doorway(floor_ptr, y, x);
- can_place_door &= !(d_info[player_ptr->dungeon_idx].flags1 & DF1_NO_DOORS);
+ can_place_door &= (d_info[player_ptr->dungeon_idx].flags1 & DF1_NO_DOORS) == 0;
if (can_place_door)
{
place_random_door(player_ptr, y, x, FALSE);
/* Take or Kill objects on the floor */
bool is_takable_or_killable = g_ptr->o_idx > 0;
- is_takable_or_killable &= (r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM));
- is_takable_or_killable &= !is_pet(m_ptr) || ((target_ptr->pet_extra_flags & PF_PICKUP_ITEMS) && (r_ptr->flags2 & RF2_TAKE_ITEM));
+ is_takable_or_killable &= (r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM)) != 0;
+ bool is_pickup_items = (target_ptr->pet_extra_flags & PF_PICKUP_ITEMS) != 0;
+ is_pickup_items &= (r_ptr->flags2 & RF2_TAKE_ITEM) != 0;
+ is_takable_or_killable &= !is_pet(m_ptr) || is_pickup_items;
if (!is_takable_or_killable)
{
if (do_turn) break;
floor_ptr->object_level = floor_ptr->base_level;
coin_type = 0;
- bool visible = (m_ptr->ml && !player_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE);
+ bool visible = (m_ptr->ml && !player_ptr->image) || ((r_ptr->flags1 & RF1_UNIQUE) != 0);
if (visible && (dump_item || dump_gold))
{
lore_treasure(player_ptr, m_idx, dump_item, dump_gold);
}
bool is_anywhere = current_world_ptr->wizard;
- is_anywhere &= !(mode & TELEPORT_PASSIVE);
+ is_anywhere &= (mode & TELEPORT_PASSIVE) == 0;
is_anywhere &= (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx > 0) ||
creature_ptr->current_floor_ptr->grid_array[y][x].m_idx == creature_ptr->riding;
if (is_anywhere) break;
bool is_followable = old_ml;
is_followable &= old_cdis <= MAX_SIGHT;
- is_followable &= !current_world_ptr->timewalk_m_idx;
+ is_followable &= !current_world_ptr->timewalk_m_idx > 0;
is_followable &= !tracer_ptr->phase_out;
is_followable &= los(tracer_ptr, tracer_ptr->y, tracer_ptr->x, oldfy, oldfx);
if (!is_followable) return;
}
}
- bool is_winner = wilderness[y][x].entrance;
- is_winner &= !wilderness[y][x].town;
- is_winner &= (current_world_ptr->total_winner || !(d_info[wilderness[y][x].entrance].flags1 & DF1_WINNER));
+ /*
+ * 本来は '> 0'で良いと思われるがエンバグするのも怖いので'!= 0'と記載する
+ * 問題なければ'> 0'へ置き換えること
+ */
+ bool is_winner = wilderness[y][x].entrance != 0;
+ is_winner &= !wilderness[y][x].town != 0;
+ bool is_wild_winner = (d_info[wilderness[y][x].entrance].flags1 & DF1_WINNER) == 0;
+ is_winner &= ((current_world_ptr->total_winner != 0) || is_wild_winner);
if (!is_winner) return;
/* Hack -- Backup the RNG state */