• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisione12b499f5f2f272273ec627989fb1390057a1270 (tree)
Time2002-06-03 04:55:47
Authormogami <mogami@0568...>
Commitermogami

Log Message

always_pickupがオンのとき、自動拾い/破壊の設定による破壊だけを無視して
簡易自動破壊オプションの破壊は適用するようにするはず(したつもり)だったのに、
適用されていなかったので修正。

Change Summary

Incremental Difference

--- a/src/autopick.c
+++ b/src/autopick.c
@@ -898,9 +898,11 @@ void auto_inscribe_item(int item, int idx)
898898
899899 /*
900900 * Automatically destroy an item if it is to be destroyed
901+ *
901902 */
902903 bool auto_destroy_item(int item, int autopick_idx)
903904 {
905+ bool destroy = FALSE;
904906 char o_name[MAX_NLEN];
905907 object_type *o_ptr;
906908
@@ -913,56 +915,73 @@ bool auto_destroy_item(int item, int autopick_idx)
913915 /* Get the item (on the floor) */
914916 else o_ptr = &o_list[0 - item];
915917
916- if ((autopick_idx == -1 && is_opt_confirm_destroy(o_ptr)) ||
917- (autopick_idx >= 0 && (autopick_list[autopick_idx].action & DO_AUTODESTROY)))
918+ /* Easy-Auto-Destroyer */
919+ if (is_opt_confirm_destroy(o_ptr)) destroy = TRUE;
920+
921+ if (always_pickup)
922+ {
923+ /* Protected by auto-picker */
924+ if (autopick_idx >= 0 &&
925+ !(autopick_list[autopick_idx].action & DO_AUTODESTROY))
926+ destroy = FALSE;
927+ }
928+ else
918929 {
919- disturb(0,0);
930+ /* Auto-picker/destroyer */
931+ if (autopick_idx >= 0 &&
932+ (autopick_list[autopick_idx].action & DO_AUTODESTROY))
933+ destroy = TRUE;
934+ }
920935
921- /* Describe the object (with {terrible/special}) */
922- object_desc(o_name, o_ptr, TRUE, 3);
936+ /* Not to be destroyed */
937+ if (!destroy) return FALSE;
923938
924- /* Artifact? */
925- if (!can_player_destroy_object(o_ptr))
926- {
927- /* Message */
939+ /* Now decided to destroy */
940+
941+ disturb(0,0);
942+
943+ /* Describe the object (with {terrible/special}) */
944+ object_desc(o_name, o_ptr, TRUE, 3);
945+
946+ /* Artifact? */
947+ if (!can_player_destroy_object(o_ptr))
948+ {
949+ /* Message */
928950 #ifdef JP
929- msg_format("%sは破壊不能だ。", o_name);
951+ msg_format("%sは破壊不能だ。", o_name);
930952 #else
931- msg_format("You cannot auto-destroy %s.", o_name);
953+ msg_format("You cannot auto-destroy %s.", o_name);
932954 #endif
933955
934- /* Done */
935- return TRUE;
936- }
956+ /* Done */
957+ return TRUE;
958+ }
937959
938- /* Record name of destroyed item */
939- autopick_free_entry(&autopick_entry_last_destroyed);
940- autopick_entry_from_object(&autopick_entry_last_destroyed, o_ptr);
960+ /* Record name of destroyed item */
961+ autopick_free_entry(&autopick_entry_last_destroyed);
962+ autopick_entry_from_object(&autopick_entry_last_destroyed, o_ptr);
941963
942- /* Eliminate the item (from the pack) */
943- if (item >= 0)
944- {
945- inven_item_increase(item, -(o_ptr->number));
946- inven_item_optimize(item);
947- }
964+ /* Eliminate the item (from the pack) */
965+ if (item >= 0)
966+ {
967+ inven_item_increase(item, -(o_ptr->number));
968+ inven_item_optimize(item);
969+ }
948970
949- /* Eliminate the item (from the floor) */
950- else
951- {
952- delete_object_idx(0 - item);
953- }
971+ /* Eliminate the item (from the floor) */
972+ else
973+ {
974+ delete_object_idx(0 - item);
975+ }
954976
955- /* Print a message */
977+ /* Print a message */
956978 #ifdef JP
957- msg_format("%sを自動破壊します。", o_name);
979+ msg_format("%sを自動破壊します。", o_name);
958980 #else
959- msg_format("Auto-destroying %s.", o_name);
981+ msg_format("Auto-destroying %s.", o_name);
960982 #endif
961983
962- return TRUE;
963- }
964-
965- return FALSE;
984+ return TRUE;
966985 }
967986
968987
@@ -1021,7 +1040,7 @@ void auto_pickup_items(cave_type *c_ptr)
10211040 */
10221041 else
10231042 {
1024- if (auto_destroy_item((-this_o_idx), (!always_pickup ? idx : -2)))
1043+ if (auto_destroy_item((-this_o_idx), idx))
10251044 continue;
10261045 }
10271046 }
Show on old repository browser