diff --git a/src/load.c b/src/load.c index 08b8545..e5122b5 100644 --- a/src/load.c +++ b/src/load.c @@ -339,8 +339,6 @@ static int rd_item_2(object_type *o_ptr) o_ptr->dd = o_ptr->kind->dd; o_ptr->ds = o_ptr->kind->ds; o_ptr->weight = o_ptr->kind->weight; - of_union(o_ptr->flags, o_ptr->kind->base->flags); - of_union(o_ptr->flags, o_ptr->kind->flags); for (i = 0; i < o_ptr->kind->num_pvals; i++) of_union(o_ptr->pval_flags[i], o_ptr->kind->pval_flags[i]); diff --git a/src/object/obj-util.c b/src/object/obj-util.c index f8ab4cd..c3da04b 100644 --- a/src/object/obj-util.c +++ b/src/object/obj-util.c @@ -309,6 +309,8 @@ void object_flags(const object_type *o_ptr, bitflag flags[OF_SIZE]) return; of_copy(flags, o_ptr->flags); + of_union(flags, o_ptr->kind->flags); + of_union(flags, o_ptr->kind->base->flags); } @@ -1518,6 +1520,8 @@ bool object_similar(const object_type *o_ptr, const object_type *j_ptr, object_stack_t mode) { int i; + bitflag o_flags[OF_SIZE], j_flags[OF_SIZE]; + int total = o_ptr->number + j_ptr->number; /* Check against stacking limit - except in stores which absorb anyway */ @@ -1530,7 +1534,9 @@ bool object_similar(const object_type *o_ptr, const object_type *j_ptr, if (o_ptr->kind != j_ptr->kind) return FALSE; /* Different flags don't stack */ - if (!of_is_equal(o_ptr->flags, j_ptr->flags)) return FALSE; + object_flags(o_ptr, o_flags); + object_flags(j_ptr, j_flags); + if (!of_is_equal(o_flags, j_flags)) return FALSE; /* Artifacts never stack */ if (o_ptr->artifact || j_ptr->artifact) return FALSE;