From ad8b2525a992f7aafb76e273c12536c818937961 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 10 May 2015 13:10:37 +0000 Subject: [PATCH] Fix: crash during item transformation on attached items git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7855 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Items.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 19d66cdd..f68d01e4 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -14704,6 +14704,9 @@ BOOLEAN OBJECTTYPE::TransformObject( SOLDIERTYPE * pSoldier, UINT8 ubStatusIndex // Test the parent now. See whether all attachments are still valid on it. ReInitMergedItem(pSoldier, pParent, pParent->usItem, ubStatusIndex); + // Flugente: sometimes gpItemDescObject gets corrupted during ReInitMergedItem(...), so we have to repair that here + gpItemDescObject = &gCloneItemDescObject; + gpItemDescOrigAttachmentObject = NULL; // After reiniting the attachments on the parent, "this" still exists, but the actual object is gone.