- /* Skip gold */
- if (o_ptr->tval == TV_GOLD) continue;
-
- /*
- * Skip "real" corpses and statues, to avoid extreme
- * silliness like a novice rogue pockets full of statues
- * and corpses.
- */
- if ((o_ptr->tval == TV_CORPSE) ||
- (o_ptr->tval == TV_STATUE)) continue;
-
- /* Take or Kill objects on the floor */
- if ((r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM)) &&
- (!is_pet(m_ptr) || (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)))
+ /* Scan all objects in the grid */
+ for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)