変愚蛮怒のメインリポジトリです
Revision | e12b499f5f2f272273ec627989fb1390057a1270 (tree) |
---|---|
Time | 2002-06-03 04:55:47 |
Author | mogami <mogami@0568...> |
Commiter | mogami |
always_pickupがオンのとき、自動拾い/破壊の設定による破壊だけを無視して
簡易自動破壊オプションの破壊は適用するようにするはず(したつもり)だったのに、
適用されていなかったので修正。
@@ -898,9 +898,11 @@ void auto_inscribe_item(int item, int idx) | ||
898 | 898 | |
899 | 899 | /* |
900 | 900 | * Automatically destroy an item if it is to be destroyed |
901 | + * | |
901 | 902 | */ |
902 | 903 | bool auto_destroy_item(int item, int autopick_idx) |
903 | 904 | { |
905 | + bool destroy = FALSE; | |
904 | 906 | char o_name[MAX_NLEN]; |
905 | 907 | object_type *o_ptr; |
906 | 908 |
@@ -913,56 +915,73 @@ bool auto_destroy_item(int item, int autopick_idx) | ||
913 | 915 | /* Get the item (on the floor) */ |
914 | 916 | else o_ptr = &o_list[0 - item]; |
915 | 917 | |
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 | |
918 | 929 | { |
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 | + } | |
920 | 935 | |
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; | |
923 | 938 | |
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 */ | |
928 | 950 | #ifdef JP |
929 | - msg_format("%sは破壊不能だ。", o_name); | |
951 | + msg_format("%sは破壊不能だ。", o_name); | |
930 | 952 | #else |
931 | - msg_format("You cannot auto-destroy %s.", o_name); | |
953 | + msg_format("You cannot auto-destroy %s.", o_name); | |
932 | 954 | #endif |
933 | 955 | |
934 | - /* Done */ | |
935 | - return TRUE; | |
936 | - } | |
956 | + /* Done */ | |
957 | + return TRUE; | |
958 | + } | |
937 | 959 | |
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); | |
941 | 963 | |
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 | + } | |
948 | 970 | |
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 | + } | |
954 | 976 | |
955 | - /* Print a message */ | |
977 | + /* Print a message */ | |
956 | 978 | #ifdef JP |
957 | - msg_format("%sを自動破壊します。", o_name); | |
979 | + msg_format("%sを自動破壊します。", o_name); | |
958 | 980 | #else |
959 | - msg_format("Auto-destroying %s.", o_name); | |
981 | + msg_format("Auto-destroying %s.", o_name); | |
960 | 982 | #endif |
961 | 983 | |
962 | - return TRUE; | |
963 | - } | |
964 | - | |
965 | - return FALSE; | |
984 | + return TRUE; | |
966 | 985 | } |
967 | 986 | |
968 | 987 |
@@ -1021,7 +1040,7 @@ void auto_pickup_items(cave_type *c_ptr) | ||
1021 | 1040 | */ |
1022 | 1041 | else |
1023 | 1042 | { |
1024 | - if (auto_destroy_item((-this_o_idx), (!always_pickup ? idx : -2))) | |
1043 | + if (auto_destroy_item((-this_o_idx), idx)) | |
1025 | 1044 | continue; |
1026 | 1045 | } |
1027 | 1046 | } |