Exemple #1
0
/**
 * Determine if an object can be picked up automatically.
 */
static bool auto_pickup_okay(const struct object *obj)
{
	if (!inven_carry_okay(obj)) return FALSE;
	if (OPT(pickup_always) || check_for_inscrip(obj, "=g")) return TRUE;
	if (OPT(pickup_inven) && inven_stack_okay(obj)) return TRUE;

	return FALSE;
}
Exemple #2
0
/*
 * Determine if the object can be picked up automatically.
 */
static bool auto_pickup_okay(const object_type *o_ptr)
{
	if (!inven_carry_okay(o_ptr)) return FALSE;
	if (OPT(pickup_always) || check_for_inscrip(o_ptr, "=g")) return TRUE;
	if (OPT(pickup_inven) && inven_stack_okay(o_ptr)) return TRUE;

	return FALSE;
}
Exemple #3
0
/**
 * Check if we have space for an item in the pack without overflow
 */
bool inven_carry_okay(const object_type *obj)
{
	/* Empty slot? */
	if (pack_slots_used(player) < z_info->pack_size) return TRUE;

	/* Check if it can stack */
	if (inven_stack_okay(obj)) return TRUE;

	/* Nope */
	return FALSE;
}