/** * Small helper function to see if an item seems good, bad or average based on * to_h, to_d and to_a. * * The sign of the return value announces if the object is bad (negative), * good (positive) or average (zero). */ static int is_object_good(const object_type *o_ptr) { int good = 0; good += 4 * cmp_object_trait(o_ptr->to_d, o_ptr->kind->to_d); good += 2 * cmp_object_trait(o_ptr->to_h, o_ptr->kind->to_h); good += 1 * cmp_object_trait(o_ptr->to_a, o_ptr->kind->to_a); return good; }
/** * Small helper function to see if an item seems good, bad or average based on * to_h, to_d and to_a. * * The sign of the return value announces if the object is bad (negative), * good (positive) or average (zero). */ static int is_object_good(const struct object *obj) { int good = 0; good += 4 * cmp_object_trait(obj->to_d, obj->kind->to_d); good += 2 * cmp_object_trait(obj->to_h, obj->kind->to_h); good += 1 * cmp_object_trait(obj->to_a, obj->kind->to_a); return good; }