Page MenuHomeFeedback Tracker

1.10 Gas Stove removes all it's attachments when loading in inventory of a player. (fix in here)
Closed, DuplicatePublic

Description

The portablegasstove deletes all it's attachments when loading in. That is due to the canreceiveattachment being bugged.
I fixed it in the DUG mod through the following code (commented out original included). I had to unwind all the stuff from ItemBase inheritance upwards into it ofcourse. :)

modded class PortableGasStove extends ItemBase
{
	override bool CanReceiveAttachment( EntityAI attachment, int slotId )
	{
		GameInventory attachmentInv = attachment.GetInventory();
		if (attachmentInv && attachmentInv.GetCargo() && attachmentInv.GetCargo().GetItemCount() > 0)
		{
			if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
				return false;
		}

        return true;
/*
		if ( GetHierarchyParent() && !GetHierarchyParent().IsMan() )
			return false;

		return super.CanReceiveAttachment(attachment, slotId);
*/
	}    
}

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10
Category
General
Steps To Reproduce

Put a PortableGasStove with Pot and LargeGasCannister attached into your inventory
Relog
PortableGasStove is now without attachments.