void CompletelyEmptyInventory(object creature) { // clear held/worn items int i; object stuff; for (i = 0; i < NUM_INVENTORY_SLOTS; ++i) { stuff = GetItemInSlot(i, creature); DestroyObject(stuff); } // clear items in general inventory stuff = GetFirstItemInInventory(creature); while (GetIsObjectValid(stuff)) { DestroyObject(stuff); stuff = GetNextItemInInventory(creature); } }