Page MenuHomeFeedback Tracker

SCR_InventoryStorageManagerComponent::OnItemAdded invoke duplicate in certain scenarios
Closed, ResolvedPublic

Description

When picking up an item via X or right-click the SCR_InventoryStorageManagerComponent::OnItemAdded event triggers twice when picking up an item. In some situations, it invokes only once correctly maybe because an item of the same type was already present in the target storage, but as the video below shows for others it does not.

This makes it very difficult to do any scripting related to the event as you can not know if the event will be called once or twice per inventory operation. If on the first call some destructive work is done, e.g. removing information from a buffer, the second invoke will behave differently.

modded class SCR_InventoryStorageManagerComponent
{
	//------------------------------------------------------------------------------------------------
	override protected void OnItemAdded(BaseInventoryStorageComponent storageOwner, IEntity item)
	{
		PrintFormat("%1 added to %2", item, storageOwner);
		super.OnItemAdded(storageOwner, item);
	}
}

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Geez changed the task status from New to Awaiting internal Testing.Sep 15 2022, 12:45 PM
Arkensor added a subscriber: Geez.Oct 1 2022, 12:03 PM

@Geez this is now resolved as of 0.9.6

Geez closed this task as Resolved.Oct 6 2022, 2:09 PM
Geez claimed this task.