Define topmostness by how low the thing's type ID is.
"""
# 7DRL: Non-player picking up player-dropped consumable -> GOD_FAVOR gain.
+ # 7DRL: Only player picks up non-food.
used_slots = len(t["T_CARRIES"]) # #
if used_slots < world_db["ThingTypes"][t["T_TYPE"]]["TT_STORAGE"]: # #
ids = [id for id in world_db["Things"] if world_db["Things"][id] != t
for iid in ids:
tid = world_db["Things"][iid]["T_TYPE"]
if lowest_tid == -1 or tid < lowest_tid:
+ if (t != world_db["Things"][0] and # #
+ world_db["ThingTypes"][tid]["TT_TOOL"] != "food"):
+ continue
id = iid
lowest_tid = tid
world_db["Things"][id]["carried"] = True