Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 2d9e66a

Browse files
committed
Fix crash when you drop item that's set to delete when removed from parent using full inventory
1 parent ccbf0b5 commit 2d9e66a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Menus/InventoryMenuGUI.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,10 @@ namespace RTE {
13011301
};
13021302

13031303
if (m_GUISelectedItem->EquippedItemIndex > -1) {
1304-
LaunchInventoryItem(dynamic_cast<Arm *>(m_GUISelectedItem->Object->GetParent())->RemoveAttachable(dynamic_cast<Arm *>(m_GUISelectedItem->Object->GetParent())->GetHeldDevice()));
1304+
Attachable *itemToLaunch = dynamic_cast<Arm *>(m_GUISelectedItem->Object->GetParent())->RemoveAttachable(dynamic_cast<Arm *>(m_GUISelectedItem->Object->GetParent())->GetHeldDevice());
1305+
if (itemToLaunch) {
1306+
LaunchInventoryItem(itemToLaunch);
1307+
}
13051308
} else {
13061309
LaunchInventoryItem(m_InventoryActor->RemoveInventoryItemAtIndex(m_GUISelectedItem->InventoryIndex));
13071310
}

0 commit comments

Comments
 (0)