Page MenuHomeFeedback Tracker

CanReceiveItemIntoCargo Affecting popular mods, and is not modable
Assigned, UrgentPublic

Description

Hello,

In 1.08 the below code was introduced into inventoryitem.c / class clothing / CanReceiveItemIntoCargo.
I dont fully understand the reasons for this. But it is causing issues with modded containers that have attachment slots for clothing.
For example, OP_BaseItems has a locker, with all the same attachment slots as a player.
But now, those items must be removed, before items can be put inside.

I would work around this myself, but the Clothing class is not moddable...

Could you please wrap this in a function that i can mod ?

I realize that there are other tickets for this same issue. But they are requesting you make Clothing moddable, which might be much harder than a moddable wrapper function IMO.

Thanks :)

		override bool CanReceiveItemIntoCargo( EntityAI cargo )
		{
			if (!super.CanReceiveItemIntoCargo(cargo))
				return false;
		
			EntityAI hierarchyParent = GetHierarchyParent();
			return !hierarchyParent || hierarchyParent.IsMan() || SmershException(hierarchyParent);
		}

Details

Severity
Tweak
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
1909
Category
General
Steps To Reproduce

Have a non man container, with clothing attachments.
Try and put items in that clothing.

Cant mod this behaviour because the Clothing class is not moddable.

Event Timeline

zysen created this task.Jul 23 2020, 12:33 AM
zysen updated the task description. (Show Details)
zysen updated the task description. (Show Details)Jul 23 2020, 12:47 AM
Geez changed the task status from New to Need More Info.Jul 23 2020, 10:15 AM
Geez changed the task status from Need More Info to Assigned.Jul 23 2020, 11:25 AM

Same bug appears in vanilla, putting a clothing item into the buttpack of the smreshvest when it's attached, will not work.
https://gfycat.com/relievedfairgalapagostortoise

here's why it appeared in 1.08:


Diff from 107->108:

I commented out the following line:
`

return !parent.GetHierarchyParent() || parent.GetHierarchyParent().IsMan();

`

after which the clothing would go into the buttpack just fine:
https://gfycat.com/bewitchedflashyglobefish