Skip to content

Commit

Permalink
Merge branch 'develop' into macos-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
backwardsEric committed Jan 19, 2025
2 parents 2e1795e + 1c396a4 commit 223dd88
Show file tree
Hide file tree
Showing 40 changed files with 447 additions and 638 deletions.
2 changes: 1 addition & 1 deletion src/autopick/autopick-destroyer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static bool is_leave_special_item(PlayerType *player_ptr, ItemEntity *o_ptr)
const auto &bi_key = o_ptr->bi_key;
const auto tval = bi_key.tval();
if (PlayerRace(player_ptr).equals(PlayerRaceType::BALROG)) {
if (o_ptr->is_corpse() && o_ptr->get_monrace().symbol_char_is_any_of("pht")) {
if (o_ptr->is_corpse() && o_ptr->get_monrace().is_human()) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/autopick/autopick-entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ void autopick_entry_from_object(PlayerType *player_ptr, autopick_type *entry, co
}

if (tval == ItemKindType::MONSTER_REMAINS) {
if (o_ptr->get_monrace().symbol_char_is_any_of("pht")) {
if (o_ptr->get_monrace().is_human()) {
entry->add(FLG_HUMAN);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/autopick/autopick-matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ bool is_autopick_match(PlayerType *player_ptr, const ItemEntity *o_ptr, const au

if (entry.has(FLG_HUMAN) && o_ptr->has_monrace()) {
const auto &monrace = o_ptr->get_monrace();
if (tval != ItemKindType::MONSTER_REMAINS || !monrace.symbol_char_is_any_of("pht")) {
if (tval != ItemKindType::MONSTER_REMAINS || !monrace.is_human()) {
return false;
}
}
Expand Down
13 changes: 7 additions & 6 deletions src/cmd-io/cmd-autopick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "util/bit-flags-calculator.h"
#include "util/int-char-converter.h"
#include "world/world.h"

/*
* Check special key code and get a movement command id
*/
static int analyze_move_key(text_body_type *tb, int skey)
static int analyze_move_key(text_body_type *tb, uint32_t skey)
{
int com_id;
if (!(skey & SKEY_MASK)) {
Expand All @@ -49,11 +50,11 @@ static int analyze_move_key(text_body_type *tb, int skey)
case SKEY_PGDOWN:
com_id = EC_PGDOWN;
break;
case SKEY_TOP:
com_id = EC_TOP;
case SKEY_HOME:
com_id = any_bits(skey, SKEY_MOD_CONTROL) ? EC_TOP : EC_BOL;
break;
case SKEY_BOTTOM:
com_id = EC_BOTTOM;
case SKEY_END:
com_id = any_bits(skey, SKEY_MOD_CONTROL) ? EC_BOTTOM : EC_EOL;
break;
default:
return 0;
Expand Down Expand Up @@ -180,7 +181,7 @@ void do_cmd_edit_autopick(PlayerType *player_ptr)
key = inkey_special(true);

if (key & SKEY_MASK) {
com_id = analyze_move_key(tb, key);
com_id = analyze_move_key(tb, static_cast<uint32_t>(key));
} else if (key == ESCAPE) {
com_id = do_command_menu(0, 0);
tb->dirty_flags |= DIRTY_SCREEN;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd-item/cmd-eat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ void exe_eat_food(PlayerType *player_ptr, INVENTORY_IDX i_idx)

/* Balrogs change humanoid corpses to energy */
if (food_type == PlayerRaceFoodType::CORPSE) {
if (o_ptr->is_corpse() && o_ptr->get_monrace().symbol_char_is_any_of("pht")) {
if (o_ptr->is_corpse() && o_ptr->get_monrace().is_human()) {
const auto item_name = describe_flavor(player_ptr, *o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
msg_format(_("%sは燃え上り灰になった。精力を吸収した気がする。", "%s^ is burnt to ashes. You absorb its vitality!"), item_name.data());
(void)set_food(player_ptr, PY_FOOD_MAX - 1);
Expand Down
4 changes: 2 additions & 2 deletions src/cmd-visual/cmd-draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ void do_cmd_messages(int num_now)

break;
}
case SKEY_TOP:
case SKEY_HOME:
base_msg_num = oldest_base_msg_num;
break;
case SKEY_BOTTOM:
case SKEY_END:
base_msg_num = 0;
break;
case '8':
Expand Down
4 changes: 2 additions & 2 deletions src/core/asking-player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ std::optional<std::string> askfor(int len, std::string_view initial_value, bool
pos++;
#endif
break;
case SKEY_TOP:
case SKEY_HOME:
case KTRL('a'):
color = TERM_WHITE;
pos = 0;
break;
case SKEY_BOTTOM:
case SKEY_END:
case KTRL('e'):
color = TERM_WHITE;
pos = std::string_view(buf.data()).length();
Expand Down
4 changes: 2 additions & 2 deletions src/core/show-file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,10 @@ void FileDisplayer::display(bool show_version, std::string_view name_with_tag, i

break;
}
case SKEY_TOP:
case SKEY_HOME:
line = 0;
break;
case SKEY_BOTTOM:
case SKEY_END:
line = ((size - 1) / rows) * rows;
break;
case '%': {
Expand Down
8 changes: 4 additions & 4 deletions src/effect/effect-feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ bool affect_feature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POS
if (terrain.flags.has_not(TerrainCharacteristics::FLOOR)) {
break;
}
cave_set_feat(player_ptr, y, x, feat_shallow_lava);
cave_set_feat(player_ptr, pos, TerrainTag::SHALLOW_LAVA);
} else if (dam) {
cave_set_feat(player_ptr, y, x, feat_deep_lava);
cave_set_feat(player_ptr, pos, TerrainTag::DEEP_LAVA);
}

break;
Expand All @@ -331,9 +331,9 @@ bool affect_feature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POS
if (terrain.flags.has_not(TerrainCharacteristics::FLOOR)) {
break;
}
cave_set_feat(player_ptr, y, x, feat_shallow_water);
cave_set_feat(player_ptr, pos, TerrainTag::SHALLOW_WATER);
} else if (dam) {
cave_set_feat(player_ptr, y, x, feat_deep_water);
cave_set_feat(player_ptr, pos, TerrainTag::DEEP_WATER);
}

break;
Expand Down
Loading

0 comments on commit 223dd88

Please sign in to comment.