From 7cf7ebaf6d6dfc5aa891cba791fb0681ba522c92 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 7 Jan 2017 14:29:04 +0100 Subject: [PATCH] - fixed: A_SetInventory must check for voodoo dolls and delegate the action to the real player because it will always break the real player's inventory if done so. --- src/p_actionfunctions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 5bf5bf450..f4b2f8103 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -2500,6 +2500,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetInventory) ACTION_RETURN_BOOL(false); } + // Do not run this function on voodoo dolls because the way they transfer the inventory to the player will not work with the code below. + if (mobj->player != nullptr) + { + mobj = mobj->player->mo; + } + AInventory *item = mobj->FindInventory(itemtype); if (item != nullptr)