game: Extract function update_inventories() from larger function