Call Delete() instead of deleting the item as it could cause issues if the item is being deleted while iterating over edicts

This commit is contained in:
smallmodel 2024-10-06 19:57:03 +02:00
parent f5558d106e
commit a5058c7bab
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -1032,7 +1032,7 @@ void Sentient::FreeInventory(void)
num = inventory.NumObjects();
for (i = num; i > 0; i--) {
item = (Item *)G_GetEntity(inventory.ObjectAt(i));
delete item;
item->Delete();
}
inventory.ClearObjectList();