From 978667143c4acc49e323cb68cad0483a0b665ad8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 29 Oct 2014 08:54:14 +0100 Subject: [PATCH] - fixed: P_RemoveThing must not remove owned inventory items. --- src/p_things.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_things.cpp b/src/p_things.cpp index 2a93ee31e0..a8d0404b69 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -402,10 +402,14 @@ void P_RemoveThing(AActor * actor) // Don't remove live players. if (actor->player == NULL || actor != actor->player->mo) { + // Don't also remove owned inventory items + if (actor->IsKindOf(RUNTIME_CLASS(AInventory)) && static_cast(actor)->Owner == NULL) return; + // be friendly to the level statistics. ;) actor->ClearCounters(); actor->Destroy (); } + } bool P_Thing_Raise(AActor *thing)