OSDN Git Service

Revert "Revert "Merge branch 'master' of git.osdn.net:/gitroot/hengband/hengband""
[hengband/hengband.git] / src / autopick / autopick-matcher.c
index 1486cd4..c958e46 100644 (file)
@@ -8,6 +8,7 @@
 #include "autopick/autopick-matcher.h"
 #include "autopick/autopick-flags-table.h"
 #include "autopick/autopick-key-flag-process.h"
+#include "inventory/inventory-slot-types.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags1.h"
 #include "perception/object-perception.h"
 #include "object-hook/hook-armor.h"
 #include "object-hook/hook-bow.h"
 #include "object-hook/hook-checker.h"
-#include "object/object-hook.h"
+#include "object-hook/hook-enchant.h"
+#include "object-hook/hook-quest.h"
+#include "object-hook/hook-weapon.h"
 #include "object/object-kind.h"
 #include "object/object-stack.h"
 #include "object/object-value.h"
 #include "object/object-info.h"
 #include "object-enchant/special-object-flags.h"
+#include "player/player-realm.h"
 #include "util/string-processor.h"
 
 /*
@@ -211,14 +215,12 @@ bool is_autopick_match(player_type *player_ptr, object_type *o_ptr, autopick_typ
                        check_book_realm(player_ptr, o_ptr->tval, o_ptr->sval)))
                return FALSE;
 
-       if (IS_FLG(FLG_REALM1) &&
-               (REALM1_BOOK != o_ptr->tval ||
+       if (IS_FLG(FLG_REALM1) && (get_realm1_book(player_ptr) != o_ptr->tval ||
                        player_ptr->pclass == CLASS_SORCERER ||
                        player_ptr->pclass == CLASS_RED_MAGE))
                return FALSE;
 
-       if (IS_FLG(FLG_REALM2) &&
-               (REALM2_BOOK != o_ptr->tval ||
+       if (IS_FLG(FLG_REALM2) && (get_realm2_book(player_ptr) != o_ptr->tval ||
                        player_ptr->pclass == CLASS_SORCERER ||
                        player_ptr->pclass == CLASS_RED_MAGE))
                return FALSE;