Page MenuHomeFeedback Tracker

Clothing cargo exception rework
Reviewed, NormalPublic

Description

It's a bit tedious using IsKindOf and IsInherited when scripting cargo exceptions for clothing, as it doesn't really scale well. I'm attaching a simple proposal to make this a lot easier for modders. Please advise these changes. I only included changes I made, and left Clothing#SmershException for backwards compatibility, as some mods use and overwrite this.

Details

Severity
Tweak
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Modding
Additional Information
class Clothing
{
	bool CanReceiveItemIntoCargoClothingConditions(EntityAI item)
	{
		EntityAI hierarchyParent = GetHierarchyParent();
		return !hierarchyParent || hierarchyParent.IsMan() || SmershException(hierarchyParent) || parent.HasClothingCargoException();
	}

	bool CanLoadItemIntoCargoClothingConditions(EntityAI item)
	{
		EntityAI parent = GetHierarchyParent();
		return !parent || parent.IsMan() || SmershException(parent) || parent.HasClothingCargoException();
	}
}

class EntityAI
{
	bool HasClothingCargoException()
	{
		return false;
	}
}

class SmershVest
{
	override bool HasClothingCargoException()
	{
		return true;
	}
}

class UndergroundStash
{
	override bool HasClothingCargoException()
	{
		return true;
	}
}

Event Timeline

OfficialWardog edited Additional Information. (Show Details)Nov 18 2022, 3:38 AM
Tyson added a subscriber: Tyson.Nov 18 2022, 3:39 AM
Geez changed the task status from New to Reviewed.Nov 22 2022, 8:49 AM
Geez added a subscriber: Geez.

Hello OfficialWardog.
Thank you for your feedback, this indeed could be a solution, however, we believe it is not a proper solution to the problem. We are aware of this and it needs more work on our side.
Regards,
Geez