OSDN Git Service
(root)
/
hengbandforosx
/
hengbandosx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
fcd5c6f
)
Merge pull request #3749 from Hourier/Fix-Broken-Chest-Crash
author
Hourier
<66951241+Hourier@users.noreply.github.com>
Thu, 23 Nov 2023 03:13:09 +0000
(12:13 +0900)
committer
GitHub
<noreply@github.com>
Thu, 23 Nov 2023 03:13:09 +0000
(12:13 +0900)
トラップ付の箱を開けた時、箱が破損する処理と中のアイテムを取り出す処理が競合してクラッシュする不具合を解消した
src/specific-object/chest.cpp
patch
|
blob
|
history
diff --git
a/src/specific-object/chest.cpp
b/src/specific-object/chest.cpp
index
ac1c759
..
5fbff7f
100644
(file)
--- a/
src/specific-object/chest.cpp
+++ b/
src/specific-object/chest.cpp
@@
-58,6
+58,10
@@
void Chest::chest_death(bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx)
BIT_FLAGS mode = AM_GOOD | AM_FORBID_CHEST;
auto *floor_ptr = this->player_ptr->current_floor_ptr;
auto *o_ptr = &floor_ptr->o_list[o_idx];
+ if (!o_ptr->is_valid()) {
+ msg_print(_("箱は既に壊れてしまっている…", "The chest was broken and you couldn't open it..."));
+ return;
+ }
/* Small chests often hold "gold" */
const auto sval = *o_ptr->bi_key.sval();