OSDN Git Service

hengbandforosx/hengbandosx.git
16 months agoMerge pull request #3005 from sikabane-works/release/3.0.0Alpha73 3.0.0Alpha73
Deskull [Sun, 25 Dec 2022 13:20:04 +0000 (22:20 +0900)]
Merge pull request #3005 from sikabane-works/release/3.0.0Alpha73

Release/3.0.0 alpha73

16 months ago[Release] 3.0.0Alpha73
Deskull [Sun, 25 Dec 2022 13:06:21 +0000 (22:06 +0900)]
[Release] 3.0.0Alpha73

16 months agoMerge pull request #2981 from backwardsEric/sprintf-refactor-monster_desc
Hourier [Sun, 25 Dec 2022 12:27:59 +0000 (21:27 +0900)]
Merge pull request #2981 from backwardsEric/sprintf-refactor-monster_desc

Refactor monster_desc() to avoid sprintf().  To work with the …

16 months agoMerge pull request #2974 from backwardsEric/sprintf-refactor-put_version
Hourier [Sun, 25 Dec 2022 12:27:08 +0000 (21:27 +0900)]
Merge pull request #2974 from backwardsEric/sprintf-refactor-put_version

Rename put_version() to get_version(); refactor it to avoid sprintf()…

16 months agoMerge pull request #3000 from habu1010/feature/refactor-item-inscription-to-string
Habu [Sun, 25 Dec 2022 07:04:17 +0000 (16:04 +0900)]
Merge pull request #3000 from habu1010/feature/refactor-item-inscription-to-string

[Refactor] ItemEntity::inscription の型を変更

16 months agoMerge pull request #2999 from habu1010/feature/fix-torch-stack
Habu [Sun, 25 Dec 2022 06:48:20 +0000 (15:48 +0900)]
Merge pull request #2999 from habu1010/feature/fix-torch-stack

[Fix] 光源のスタックの挙動がおかしい

16 months ago[Refactor] ItemEntity::inscription の型を変更
Habu [Sun, 25 Dec 2022 05:37:50 +0000 (14:37 +0900)]
[Refactor] ItemEntity::inscription の型を変更

既存の quark_str のインデクスを持たせる方式から文字列を直接持たせる方式に変更する。
空文字列を銘を刻んでいない状態とするのはやや紛らわしくなるので、
std::optional<std::string> 型とし、銘を刻んでいない場合は値を std::nullopt と
する。

16 months ago[Fix] 光源のスタックの挙動がおかしい
Habu [Sun, 25 Dec 2022 06:07:14 +0000 (15:07 +0900)]
[Fix] 光源のスタックの挙動がおかしい

光源のスタックの挙動において、重なるべきものが重ならなかったり、逆に重ならないはずのも
のが重なったりする。
おかしな挙動の原因は2つ。

- 初期所持の光源は pval が初期値のままだが、店売りアイテムは LiteEnchanter により
  pval が 0 になる。したがって pval が異なることにより重ならない。
- 店のアイテムのスタック判定 store_object_similar で fuel の値が考慮されていない
  ため、残りターン数が異なっても重なってしまう。

LiteEnchanter で pval を 0 にせずそのままの値とし、store_object_similar には
fuel の比較を追加することで修正する。

16 months agoMerge pull request #2997 from habu1010/feature/refactor-itementity-art_name
Habu [Sun, 25 Dec 2022 04:05:44 +0000 (13:05 +0900)]
Merge pull request #2997 from habu1010/feature/refactor-itementity-art_name

[Refactor] ItemEntity::art_name の型/名称を変更

16 months agoMerge pull request #2996 from habu1010/feature/fix-monster-expload-no-damge
Habu [Sun, 25 Dec 2022 03:31:46 +0000 (12:31 +0900)]
Merge pull request #2996 from habu1010/feature/fix-monster-expload-no-damge

[Fix] モンスターの爆発でプレイヤーがダメージを受けない

16 months agoMerge pull request #2994 from habu1010/feature/fix-killing-monster-message
Habu [Sun, 25 Dec 2022 03:31:34 +0000 (12:31 +0900)]
Merge pull request #2994 from habu1010/feature/fix-killing-monster-message

[Fix] モンスターを倒した時のメッセージがおかしい

16 months ago[Refactor] ItemEntity::art_name の型/名称を変更
Habu [Sun, 25 Dec 2022 03:27:51 +0000 (12:27 +0900)]
[Refactor] ItemEntity::art_name の型/名称を変更

quark_add/quark_str のインデクスを持たせるのではなく直接文字列を持たせるようにする。
既存のインデクスが0以外ならランダムアーティファクト、0なら非ランダムアーティファクト
という仕様を維持するため std::optional<std::string> 型にし、非ランダムアーティファ
クトの場合は std::nullopt とする。
また明確にランダムアーティファクトの名称である事がわかるようにするためメンバの名称を
randart_name に変更する。

16 months ago[Fix] モンスターが爆発した時のメッセージ
Habu [Sun, 25 Dec 2022 02:55:10 +0000 (11:55 +0900)]
[Fix] モンスターが爆発した時のメッセージ

生命が無いモンスターが爆発した時と同じく、生命があるモンスターが爆発した時も専用のメッ
セージを表示する。

16 months ago[Fix] モンスターの爆発でプレイヤーがダメージを受けない
Habu [Sun, 25 Dec 2022 02:24:54 +0000 (11:24 +0900)]
[Fix] モンスターの爆発でプレイヤーがダメージを受けない

過去に HURT に対応する AttributeType が MONSTER_MELEE に変更されたが、その時
switch_effects_player に MONSTER_MELEE が追加されなかったため、爆発のダメージが
入らなくなっている。
ひとまず元の MISSILE と同じく MONSTER_MELEE でも effect_player_missile を呼ぶ
ようにしておく。

16 months ago[Fix] モンスターを倒した時のメッセージがおかしい
Habu [Sun, 25 Dec 2022 02:17:10 +0000 (11:17 +0900)]
[Fix] モンスターを倒した時のメッセージがおかしい

以前行われていた、モンスターを倒した時の状況に合わせた「殺した・葬り去った・倒した」の
メッセージ切り替えが、リファクタリング時にすべて「殺した」になってしまっていたので元の
仕様に戻す。

16 months agoMerge pull request #2992 from habu1010/feature/apply-kinsoku-list-to-roff
Habu [Sun, 25 Dec 2022 01:58:15 +0000 (10:58 +0900)]
Merge pull request #2992 from habu1010/feature/apply-kinsoku-list-to-roff

shape_buffer で使用している is_kinsoku 関数を c_roff の折り返し表示にも適用する

16 months agoMerge pull request #2989 from habu1010/feature/fix-mod-virtue-when-make-randart
Habu [Sun, 25 Dec 2022 00:44:41 +0000 (09:44 +0900)]
Merge pull request #2989 from habu1010/feature/fix-mod-virtue-when-make-randart

[Fix] 巻物でアーティファクトを生成した時に得が変化しない事がある

16 months agoMerge pull request #2988 from habu1010/feature/refactor-determine-if-randart
Habu [Sun, 25 Dec 2022 00:44:20 +0000 (09:44 +0900)]
Merge pull request #2988 from habu1010/feature/refactor-determine-if-randart

[Refactor] アイテムがランダムアーティファクトかどうかの判定にメソッドを使用する

16 months agoMerge pull request #2987 from Hourier/Fix-Compilation-Error-Record-Play-Movie
Hourier [Sun, 25 Dec 2022 00:42:22 +0000 (09:42 +0900)]
Merge pull request #2987 from Hourier/Fix-Compilation-Error-Record-Play-Movie

record-play-movie.cpp のコンパイルエラーを修正した

16 months ago[Fix] c_roff 関数の禁則処理に is_kinsoku 関数を適用する
Habu [Sat, 24 Dec 2022 18:15:36 +0000 (03:15 +0900)]
[Fix] c_roff 関数の禁則処理に is_kinsoku 関数を適用する

c_roff 関数で行頭禁則を行う文字は現在句読点のみとなっているが、shape_buffer リファ
クタリング時に作成した禁則文字判定関数 is_kinsoku を適用して、他の行頭禁則するべき
文字でも禁則処理が行われるようにする。

16 months ago[Refactor] is_kinsoku 関数を japanese.cpp/h に移設
Habu [Sat, 24 Dec 2022 18:12:34 +0000 (03:12 +0900)]
[Refactor] is_kinsoku 関数を japanese.cpp/h に移設

shape_buffer からだけでなく他の翻訳単位からも使用できるようにグローバルスコープ関数
にする。

16 months ago[Fix] 巻物でアーティファクトを生成した時に得が変化しない事がある
Habu [Sat, 24 Dec 2022 14:56:12 +0000 (23:56 +0900)]
[Fix] 巻物でアーティファクトを生成した時に得が変化しない事がある

アーティファクト生成の巻物でランダムアーティファクトを生成した時、「秘」と「個」の徳が
上昇するようになっているが、名付けをキャンセルしてランダムな名前を付けた時にこれらの徳
があがらなくなっている。
常に上昇するよう修正する。

16 months ago[Refactor] アイテムがランダムアーティファクトかどうかの判定にメソッドを使用する
Habu [Sat, 24 Dec 2022 14:37:19 +0000 (23:37 +0900)]
[Refactor] アイテムがランダムアーティファクトかどうかの判定にメソッドを使用する

現状、アイテムがランダムアーティファクトかどうかの判定は art_name が 0 かどうか
(art_name は名称が登録された quark_str のインデクスを持つ) で判断しており、それを
ラップするメソッド ItemEntity::is_random_artifact が用意されているがこれが正しく
使用されていない箇所が多数あるので、すべてこのメソッドを使用するように変更する。

16 months agoMerge pull request #2984 from backwardsEric/counts_seek-uninit-write
Habu [Sat, 24 Dec 2022 14:09:10 +0000 (23:09 +0900)]
Merge pull request #2984 from backwardsEric/counts_seek-uninit-write

Initialize all of a buffer in counts_seek().  …

16 months agoInitialize all of a buffer in counts_seek(). Resolves https://github.com/hengband...
Eric Branlund [Sat, 24 Dec 2022 13:52:31 +0000 (06:52 -0700)]
Initialize all of a buffer in counts_seek().  Resolves https://github.com/hengband/hengband/issues/2983 .  Initialize all of temp2 as well to silence bogus Visual Studio 2022 warning.

16 months ago[Refactor] ItemEntity に銘が刻まれているかどうか判定するメソッドを追加
Habu [Sun, 25 Dec 2022 04:35:52 +0000 (13:35 +0900)]
[Refactor] ItemEntity に銘が刻まれているかどうか判定するメソッドを追加

銘が刻まれているかどうかの判定を ItemEntity::inscription の値が非ゼロかどうか比較
することで行っているが、inscription の std::string 化にそなえて
ItemEntity::is_inscribed() を新設し、判定箇所をこのメソッドで置き換える。

16 months agoMerge pull request #2980 from habu1010/feature/refactor-show-killing-monster
Habu [Sat, 24 Dec 2022 06:43:15 +0000 (15:43 +0900)]
Merge pull request #2980 from habu1010/feature/refactor-show-killing-monster

[Fix/Refactor] 殺されたモンスター名を墓石に表示するコード

16 months ago[Refactor] split_max を大文字のSPLIT_MAX に変更した
Hourier [Sat, 24 Dec 2022 06:06:28 +0000 (15:06 +0900)]
[Refactor] split_max を大文字のSPLIT_MAX に変更した

16 months ago[Refactor] send_text_to_chuukei_server() をearly return に変更した
Hourier [Sat, 24 Dec 2022 06:05:35 +0000 (15:05 +0900)]
[Refactor] send_text_to_chuukei_server() をearly return に変更した

16 months ago[Fix] Shift-JISかつ日本語の時にコンパイルエラーが出る箇所を修正した
Hourier [Sat, 24 Dec 2022 06:02:06 +0000 (15:02 +0900)]
[Fix] Shift-JISかつ日本語の時にコンパイルエラーが出る箇所を修正した

16 months agoMerge pull request #2986 from habu1010/feature/fix-signal-handler-for-sigkill
Habu [Sat, 24 Dec 2022 04:42:20 +0000 (13:42 +0900)]
Merge pull request #2986 from habu1010/feature/fix-signal-handler-for-sigkill

[Fix] SIGKILL にシグナルハンドラを設定している

16 months agoMerge pull request #2985 from habu1010/feature/fix-to-not-use-one-ranges-proposal
Habu [Sat, 24 Dec 2022 04:06:03 +0000 (13:06 +0900)]
Merge pull request #2985 from habu1010/feature/fix-to-not-use-one-ranges-proposal

[Fix] std::ranges::transform -> std::transform

16 months agoMerge pull request #2970 from backwardsEric/sprintf-refactor-get_random_name
Hourier [Sat, 24 Dec 2022 04:02:43 +0000 (13:02 +0900)]
Merge pull request #2970 from backwardsEric/sprintf-refactor-get_random_name

Refactor get_table_{name,name_aux,sindarin,sindarin_aux}() to avoid …

16 months agoMerge pull request #2953 from backwardsEric/sprintf-refactor-record-play-movie
Hourier [Sat, 24 Dec 2022 04:00:11 +0000 (13:00 +0900)]
Merge pull request #2953 from backwardsEric/sprintf-refactor-record-play-movie

Refactor record-play-movie.cpp to avoid sprintf().  Does part of the …

16 months ago[Fix] SIGKILL にシグナルハンドラを設定している
Habu [Sat, 24 Dec 2022 03:31:10 +0000 (12:31 +0900)]
[Fix] SIGKILL にシグナルハンドラを設定している

SIGKILL はいかなる手段を用いても捕捉不可能なシグナルであり、シグナルハンドラを設定する
事自体間違いなので削除する。

16 months ago[Fix] std::ranges::transform -> std::transform
Habu [Sat, 24 Dec 2022 02:40:46 +0000 (11:40 +0900)]
[Fix] std::ranges::transform -> std::transform

Apple Clang 14 ではまだ The One Ranges Proposal がサポートされていないので、
C++20 で追加された std::ranges::* のSTLアルゴリズムが使用できない。
したがって従来の通りイテレータペアを受け取る std::transform を使用する。

16 months agoRefactor monster_desc() to avoid sprintf(). To work with the refactored monster_desc...
Eric Branlund [Fri, 23 Dec 2022 20:25:19 +0000 (13:25 -0700)]
Refactor monster_desc() to avoid sprintf().  To work with the refactored monster_desc(), refactor monster_name() and change the prototypes for MonsterDamageProcessor's death_amberites(), dying_scream(), show_bounty_message(), and show_kill_message().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoRefactor get_table_{name,name_aux,sindarin,sindarin_aux}() and sindarin_to_kana(...
Eric Branlund [Fri, 23 Dec 2022 15:57:27 +0000 (08:57 -0700)]
Refactor get_table_{name,name_aux,sindarin,sindarin_aux}() and sindarin_to_kana() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoRefactor record-play-movie.cpp to avoid sprintf(). Does part of the work of resolvin...
Eric Branlund [Fri, 23 Dec 2022 15:46:39 +0000 (08:46 -0700)]
Refactor record-play-movie.cpp to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months ago[Refactor] 墓石に文字列を表示する処理
Habu [Fri, 23 Dec 2022 15:26:05 +0000 (00:26 +0900)]
[Refactor] 墓石に文字列を表示する処理

墓石に文字列を表示する時、put_str(center_string(…), row, col)としており、
center_string をかますのと col の値は必ず同じなのでラッパー関数 show_tomb_line
を作成してそれを呼び出すようにする。これによりコードの煩雑さがかなり解消される。
center_string は他のパターンでは呼ばれないので show_tomb_line に吸収する。

16 months ago[Refactor] 墓石に表示する情報の表示座標用の定数を定義
Habu [Fri, 23 Dec 2022 14:54:47 +0000 (23:54 +0900)]
[Refactor] 墓石に表示する情報の表示座標用の定数を定義

16 months agoRename put_version() to get_version(); refactor it to avoid sprintf(). Does part...
Eric Branlund [Fri, 23 Dec 2022 14:25:19 +0000 (07:25 -0700)]
Rename put_version() to get_version(); refactor it to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months ago[Fix/Refactor] 殺されたモンスター名を墓石に表示するコード
Habu [Fri, 23 Dec 2022 14:14:03 +0000 (23:14 +0900)]
[Fix/Refactor] 殺されたモンスター名を墓石に表示するコード

プレイヤーが殺されたモンスターの名称を墓石に表示する時、最大2行にわたって表示するが、
2行に収まりきらない場合に残りを省略するコードが意図通りに動作していないので修正する。
また、モンスター名称を墓石に表示する時の仕様について doxygen コメントを追加し、関連
する周辺コードをリファクタリングする。

16 months agoMerge pull request #2979 from habu1010/feature/refactor-shape-buffer
Habu [Fri, 23 Dec 2022 13:37:13 +0000 (22:37 +0900)]
Merge pull request #2979 from habu1010/feature/refactor-shape-buffer

[Refactor] shape_buffer のシグネチャ変更に伴うリファクタリング

16 months ago[Refactor] shape_buffer のシグネチャ変更に伴うリファクタリング
Habu [Fri, 23 Dec 2022 10:39:06 +0000 (19:39 +0900)]
[Refactor] shape_buffer のシグネチャ変更に伴うリファクタリング

shape_buffer のシグネチャを結果を格納するバッファ領域を指すポインタを受け取る方式から
std::string 型文字列の配列を返す方式に変更する。

16 months agoMerge pull request #2975 from backwardsEric/sprintf-refactor-cnv_stat
Hourier [Fri, 23 Dec 2022 10:16:21 +0000 (19:16 +0900)]
Merge pull request #2975 from backwardsEric/sprintf-refactor-cnv_stat

Refactor cnv_stat() to avoid sprintf().  Does part of the work of …

16 months agoMerge pull request #2973 from backwardsEric/sprintf-refactor_get_element_effect_info
Hourier [Fri, 23 Dec 2022 10:12:38 +0000 (19:12 +0900)]
Merge pull request #2973 from backwardsEric/sprintf-refactor_get_element_effect_info

Refactor get_element_effect_info() to avoid sprintf().  Does part of …

16 months agoMerge pull request #2972 from backwardsEric/sprintf-refactor-mindcraft_info
Hourier [Fri, 23 Dec 2022 10:06:49 +0000 (19:06 +0900)]
Merge pull request #2972 from backwardsEric/sprintf-refactor-mindcraft_info

Refactor mindcraft_info() to avoid sprintf().  Does part of the work …

16 months agoMerge pull request #2971 from backwardsEric/sprintf-refactor-mane_info
Hourier [Fri, 23 Dec 2022 10:03:32 +0000 (19:03 +0900)]
Merge pull request #2971 from backwardsEric/sprintf-refactor-mane_info

Refactor mane_info() to avoid sprintf().  Does part of the work of …

16 months agoMerge pull request #2978 from habu1010/feature/language-standard-version-to-c++20
Habu [Fri, 23 Dec 2022 10:02:56 +0000 (19:02 +0900)]
Merge pull request #2978 from habu1010/feature/language-standard-version-to-c++20

[Feature] C++ 言語の標準バージョンを C++20 にする

16 months agoRefactor get_element_effect_info() to avoid sprintf(). Does part of the work of...
Eric Branlund [Thu, 22 Dec 2022 19:17:06 +0000 (12:17 -0700)]
Refactor get_element_effect_info() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoRefactor mane_info() to avoid sprintf(). Does part of the work of resolving https...
Eric Branlund [Thu, 22 Dec 2022 19:09:25 +0000 (12:09 -0700)]
Refactor mane_info() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and github.com/hengband/hengband/issues/2859 .

16 months agoRefactor mindcraft_info() to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Thu, 22 Dec 2022 19:03:08 +0000 (12:03 -0700)]
Refactor mindcraft_info() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoRefactor cnv_stat() to avoid sprintf(). Does part of the work of resolving https...
Eric Branlund [Thu, 22 Dec 2022 18:47:40 +0000 (11:47 -0700)]
Refactor cnv_stat() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months ago[Fix] maid-x11.cpp に残っていた volatile 修飾子を削除
Habu [Thu, 22 Dec 2022 14:33:32 +0000 (23:33 +0900)]
[Fix] maid-x11.cpp に残っていた volatile 修飾子を削除

C++20 では volatile は deprecated なので削除する。

16 months ago[Fix] 言語標準バージョンをチェックする autoconf 用マクロから volatile 削除
Habu [Thu, 22 Dec 2022 14:19:11 +0000 (23:19 +0900)]
[Fix] 言語標準バージョンをチェックする autoconf 用マクロから volatile 削除

C++20 では volatile は deplecated 扱いであり、configure の実行中に volatile
を含むコードで警告が発生する。CI のコンパイルテストで -Werror を指定しているため、
警告がエラー扱いとなり configure がエラー終了してしまい、その結果テストが通らなくなる。
対策として autoconf 用マクロのコードから volatile を削除する。

16 months ago[Feature] C++ 言語の標準バージョンを C++20 にする
Habu [Thu, 22 Dec 2022 13:58:34 +0000 (22:58 +0900)]
[Feature] C++ 言語の標準バージョンを C++20 にする

各プラットフォームで対応の準備が整ったので、C++ 言語の標準バージョンを C++20 にする。
なお、Visual Studio 用プロジェクトの設定は latest (C++23 の機能を含むプレビュー
バージョン)が指定されていたが、こちらも C++20 を指定することとする。

16 months agoMerge pull request #2969 from habu1010/feature/upgrade-workflow-gcc-clang-for-c++20
Habu [Thu, 22 Dec 2022 11:11:44 +0000 (20:11 +0900)]
Merge pull request #2969 from habu1010/feature/upgrade-workflow-gcc-clang-for-c++20

[Fix] CIで使用するコンパイラのバージョンをアップデート

16 months agoMerge pull request #2977 from backwardsEric/character-sheet-Actual-Current-alignment
Habu [Thu, 22 Dec 2022 09:37:40 +0000 (18:37 +0900)]
Merge pull request #2977 from backwardsEric/character-sheet-Actual-Current-alignment

English:  shift "Actual" and "Current" labels two characters to the …

16 months agoEnglish: shift "Actual" and "Current" labels two characters to the right on the...
Eric Branlund [Wed, 21 Dec 2022 21:09:06 +0000 (14:09 -0700)]
English:  shift "Actual" and "Current" labels two characters to the right on the third page of the character sheet; resolves https://github.com/hengband/hengband/issues/2976 .

16 months ago[Fix] CIで使用するコンパイラのバージョンをアップデート
Habu [Wed, 21 Dec 2022 14:34:50 +0000 (23:34 +0900)]
[Fix] CIで使用するコンパイラのバージョンをアップデート

C++20に備えるため、gccのバージョンを11、clangのバージョンを14にする。
また runner をこれらのコンパイラ・ツールチェインがデフォルトでインストールされている
Ubuntu-22.04 にする。
さらに Node.js 12 のサポート終了にともない、 ccache-action のバージョンを 1 から
1.2 にする。

16 months agoMerge pull request #2968 from habu1010/feature/fix-for-github-actions-nodejs-12-deple...
Habu [Wed, 21 Dec 2022 14:33:30 +0000 (23:33 +0900)]
Merge pull request #2968 from habu1010/feature/fix-for-github-actions-nodejs-12-deplecated

[Fix] Workflow ファイルの actions/checkout のバージョン更新

16 months agoMerge pull request #2966 from Hourier/Change-GetRandomLine-Signature
Hourier [Wed, 21 Dec 2022 14:32:52 +0000 (23:32 +0900)]
Merge pull request #2966 from Hourier/Change-GetRandomLine-Signature

get_random_name() の戻り値をvoidからstd::string に変え、char * の引数を削除した

16 months ago[Fix] Workflow ファイルの actions/checkout のバージョン更新
Habu [Wed, 21 Dec 2022 14:25:35 +0000 (23:25 +0900)]
[Fix] Workflow ファイルの actions/checkout のバージョン更新

GitHub Actions の Node.js 12 のサポート終了に伴い、 actions/checkout@v2 が
使用できなくなるので、actions/checkout@v3 に更新する。

16 months ago[Refactor] #2749 get_random_name() の戻り値をvoidからstd::string に変え、char * の引数を削除した
Hourier [Wed, 21 Dec 2022 14:06:24 +0000 (23:06 +0900)]
[Refactor] #2749 get_random_name() の戻り値をvoidからstd::string に変え、char * の引数を削除した

16 months agoMerge pull request #2962 from habu1010/feature/refactor-format-retval-to-string
Habu [Wed, 21 Dec 2022 12:59:34 +0000 (21:59 +0900)]
Merge pull request #2962 from habu1010/feature/refactor-format-retval-to-string

[Refactor] format 関数の戻り値を std::string にする

16 months ago[Refactor] format 関数の戻り値を std::string にする
Habu [Wed, 21 Dec 2022 10:17:04 +0000 (19:17 +0900)]
[Refactor] format 関数の戻り値を std::string にする

既存の format 関数は、結果文字列を関数内部で保持している静的バッファ領域に格納しそれ
に対するポインタを返すという仕様のため、非常に注意深く使用する必要がある。
使いにくくて仕方がないので std::string オブジェクトを返すようにし、format 関数を
呼んだ側が確実に自由に結果文字列を扱えるようにする。

16 months agoMerge pull request #2940 from backwardsEric/sprintf-string-format
Habu [Wed, 21 Dec 2022 10:08:34 +0000 (19:08 +0900)]
Merge pull request #2940 from backwardsEric/sprintf-string-format

Replace sprintf() with std::string and/or format().  Does part of the…

16 months agoReplace sprintf() with std::string and/or format(). Does part of the work of resolvi...
Eric Branlund [Tue, 20 Dec 2022 18:48:50 +0000 (11:48 -0700)]
Replace sprintf() with std::string and/or format().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoMerge pull request #2946 from backwardsEric/sprintf-refactor-tombstone-generation
Habu [Tue, 20 Dec 2022 14:15:11 +0000 (23:15 +0900)]
Merge pull request #2946 from backwardsEric/sprintf-refactor-tombstone-generation

Refactor tombstone generation to avoid sprintf().  Does part of the …

16 months agoMerge pull request #2943 from backwardsEric/sprintf-refactor-birth-selections
Habu [Tue, 20 Dec 2022 14:01:40 +0000 (23:01 +0900)]
Merge pull request #2943 from backwardsEric/sprintf-refactor-birth-selections

Refactor birth class/personality/race/sex selection to avoid sprintf()…

16 months agoRefactor tombstone generation to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Tue, 20 Dec 2022 13:45:38 +0000 (06:45 -0700)]
Refactor tombstone generation to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoRefactor birth class/personality/race/sex selection to avoid sprintf(). Does part...
Eric Branlund [Tue, 20 Dec 2022 13:40:04 +0000 (06:40 -0700)]
Refactor birth class/personality/race/sex selection to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoMerge pull request #2948 from backwardsEric/sprintf-refactor-item_activation_aux
Habu [Tue, 20 Dec 2022 13:17:15 +0000 (22:17 +0900)]
Merge pull request #2948 from backwardsEric/sprintf-refactor-item_activation_aux

Refactor item_activation_aux() to avoid sprintf().  Does part of the …

16 months agoMerge pull request #2964 from backwardsEric/view-display-util-no-pch
Hourier [Mon, 19 Dec 2022 23:24:18 +0000 (08:24 +0900)]
Merge pull request #2964 from backwardsEric/view-display-util-no-pch

Include <string> to avoid compiler error on MacOS/clang when not …

16 months agoInclude <string> to avoid compiler error on MacOS/clang when not using precompiled...
Eric Branlund [Mon, 19 Dec 2022 19:35:48 +0000 (12:35 -0700)]
Include <string> to avoid compiler error on MacOS/clang when not using precompiled headers.  Resolves https://github.com/hengband/hengband/issues/2963 .

16 months agoMerge pull request #2961 from habu1010/feature/refactor-get_quantity-signature
Habu [Mon, 19 Dec 2022 13:11:56 +0000 (22:11 +0900)]
Merge pull request #2961 from habu1010/feature/refactor-get_quantity-signature

[Refactor] get_quantity 関数のシグネチャ変更

16 months ago[Refactor] get_quantity 関数のシグネチャ変更
Habu [Mon, 19 Dec 2022 12:22:41 +0000 (21:22 +0900)]
[Refactor] get_quantity 関数のシグネチャ変更

他の get_* シリーズと違い、既存の仕様で nullptr が渡された時にデフォルトメッセージを
表示するという仕様があるので単純に std::string_view にできない。
したがって std::optional<std::string_view> にし、std::nullopt で対応する。

16 months agoMerge pull request #2957 from habu1010/feature/refactor-exe_spell-return-value
Habu [Mon, 19 Dec 2022 12:16:02 +0000 (21:16 +0900)]
Merge pull request #2957 from habu1010/feature/refactor-exe_spell-return-value

[Refactor] exe_spell 関数の戻り値の型を変更

16 months agoMerge pull request #2960 from Hourier/Fix-Compilation-Warning-LevelDesc
Hourier [Mon, 19 Dec 2022 12:07:34 +0000 (21:07 +0900)]
Merge pull request #2960 from Hourier/Fix-Compilation-Warning-LevelDesc

引数とローカル変数名の重複を解消した

16 months ago[Fix] 引数とローカル変数名の重複を解消した
Hourier [Mon, 19 Dec 2022 12:01:43 +0000 (21:01 +0900)]
[Fix] 引数とローカル変数名の重複を解消した

16 months agoMerge pull request #2936 from habu1010/feature/refactor-asking-player-function-signature
Habu [Mon, 19 Dec 2022 11:54:10 +0000 (20:54 +0900)]
Merge pull request #2936 from habu1010/feature/refactor-asking-player-function-signature

[Refactor] asking-player.cpp の関数群のシグネチャを変更

16 months agoMerge pull request #2937 from habu1010/feature/refactor-get_ability_abbreviation
Habu [Mon, 19 Dec 2022 11:53:11 +0000 (20:53 +0900)]
Merge pull request #2937 from habu1010/feature/refactor-get_ability_abbreviation

[Refactor] get_inscription 関数のシグネチャを変更

16 months agoMerge pull request #2954 from backwardsEric/sprintf-refactor-dice_to_string
Habu [Mon, 19 Dec 2022 11:48:16 +0000 (20:48 +0900)]
Merge pull request #2954 from backwardsEric/sprintf-refactor-dice_to_string

Refactor dice_to_string() to avoid sprintf().  Does part of the work …

16 months agoMerge pull request #2958 from habu1010/feature/refactor-display_player_one_line-signature
Habu [Mon, 19 Dec 2022 11:42:22 +0000 (20:42 +0900)]
Merge pull request #2958 from habu1010/feature/refactor-display_player_one_line-signature

[Refactor] display_player_one_line 関数のシグネチャ変更

16 months agoMerge pull request #2959 from habu1010/feature/refactor-concptr-to-string_view
Habu [Mon, 19 Dec 2022 11:41:49 +0000 (20:41 +0900)]
Merge pull request #2959 from habu1010/feature/refactor-concptr-to-string_view

[Refactor] いくつかの関数の文字列引数の型を std::string_view に変更

16 months ago[Refactor] get_inscription 関数のシグネチャを変更
Habu [Mon, 19 Dec 2022 11:39:28 +0000 (20:39 +0900)]
[Refactor] get_inscription 関数のシグネチャを変更

get_inscription 関数のシグネチャを、文字列を格納するバッファを指すポインタ引数を受け
取る方式から std::string 型の戻り値で文字列を返す方式に変更する。

16 months ago[Refactor] いくつかの関数の文字列引数の型を std::string_view に変更
Habu [Mon, 19 Dec 2022 11:16:36 +0000 (20:16 +0900)]
[Refactor] いくつかの関数の文字列引数の型を std::string_view に変更

format 関数の戻り値を std::string にするにあたり、事前のリサーチで format の戻り
値を直接渡している関数のうち使用箇所が多く std::string_view に変更しておいたほうが
良いと思われる以下のものを先に変更しておく。

- load_note
- roff 系関数

16 months ago[Refactor] exe_spell 関数の戻り値の型を変更
Habu [Mon, 19 Dec 2022 10:07:56 +0000 (19:07 +0900)]
[Refactor] exe_spell 関数の戻り値の型を変更

現在 exe_spell 関数の戻り値の型は concptr であり、SpellProcessType 型の引数の値
により関数の処理内容が切り替わるとともに戻り値の意味も変化する。
大雑把には魔法の名称や情報を得る時はその文字列(静的リテラルや format 関数の静的バッ
ファ)を指すポインタが返り、魔法を実行するときは実行したなら空文字列リテラルへのポイン
タ、キャンセルしたなら nullptr が返る。
format 関数の戻り値を std::string にすると exe_spell の戻り値も std::string に
する必要があるが、std::string に nullptr を入れることはできない。そこで戻り値を
std::optional<std::string> に変更してキャンセル時には std::nullopt を返すように
変更する。

16 months ago[Refactor] display_player_one_line 関数のシグネチャ変更
Habu [Mon, 19 Dec 2022 09:07:24 +0000 (18:07 +0900)]
[Refactor] display_player_one_line 関数のシグネチャ変更

display_player_one_line 関数は format 関数の戻り値をダイレクトに渡している箇所が
多いので、format 関数の戻り値が std::string になっても変更しなくてすむように引数を
concptr から std::string_view に変更する。
また、現在 std::string::data() メソッドを呼び出して渡している箇所は、data() の呼
び出しが不要になるので std::string オブジェクトをそのまま渡すようにする。

16 months ago[Refactor] asking-player.cpp の関数群のシグネチャを変更
Habu [Mon, 19 Dec 2022 06:58:21 +0000 (15:58 +0900)]
[Refactor] asking-player.cpp の関数群のシグネチャを変更

asking-player.cpp で定義されている、ユーザに入力を促す get_* の関数群に与えるの
メッセージの引数の型を concptr から std::string_view に変更する。
但し、get_quantity は nullptr の時にデフォルトメッセージを表示するという例外がある
ので別途対応する。

16 months agoRefactor dice_to_string() to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Mon, 19 Dec 2022 05:45:14 +0000 (22:45 -0700)]
Refactor dice_to_string() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoRefactor item_activation_aux() to avoid sprintf(). Does part of the work of resolvin...
Eric Branlund [Mon, 19 Dec 2022 03:45:06 +0000 (20:45 -0700)]
Refactor item_activation_aux() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoMerge pull request #2951 from backwardsEric/sprintf-refactor-write-diary
Habu [Mon, 19 Dec 2022 03:24:26 +0000 (12:24 +0900)]
Merge pull request #2951 from backwardsEric/sprintf-refactor-write-diary

Refactor write-diary.cpp to avoid sprintf().  Does part of the work of…

16 months agoMerge pull request #2947 from backwardsEric/sprintf-refactor-likert
Habu [Mon, 19 Dec 2022 03:16:10 +0000 (12:16 +0900)]
Merge pull request #2947 from backwardsEric/sprintf-refactor-likert

Refactor likert() to avoid sprintf().  Does part of the work of …

16 months agoRefactor likert() to avoid sprintf(). Does part of the work of resolving https:...
Eric Branlund [Sun, 18 Dec 2022 15:12:40 +0000 (08:12 -0700)]
Refactor likert() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoRefactor write-diary.cpp to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Sun, 18 Dec 2022 14:39:58 +0000 (07:39 -0700)]
Refactor write-diary.cpp to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

16 months agoMerge pull request #2941 from backwardsEric/sprintf-refactor-name_unnatural_random_ar...
Habu [Sun, 18 Dec 2022 06:58:57 +0000 (15:58 +0900)]
Merge pull request #2941 from backwardsEric/sprintf-refactor-name_unnatural_random_artifact

Refactor name_unnatural_random_artifact() to avoid sprintf().  Does …

16 months agoMerge pull request #2942 from backwardsEric/sprintf-refactor-floor-save
Habu [Sun, 18 Dec 2022 06:54:21 +0000 (15:54 +0900)]
Merge pull request #2942 from backwardsEric/sprintf-refactor-floor-save

Refactor floor/floor-save.cpp to avoid sprintf().  Does part of the …

16 months agoMerge pull request #2944 from backwardsEric/sprintf-refactor-init_angband
Habu [Sun, 18 Dec 2022 06:49:15 +0000 (15:49 +0900)]
Merge pull request #2944 from backwardsEric/sprintf-refactor-init_angband

Refactor init_angband() to avoid sprintf().  Does part of the work of…