Page MenuHomeFeedback Tracker

Workbench "Assertion failed"
Closed, ResolvedPublic

Description

After using this code to delete all characters equipment in runtime. The next Code Compile Crashes.

class ARU_ScriptedUserAction_UI_Test: ARU_ScriptedUserAction
{	
	//------------------------------------------------------------------------------------------------
	override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity) 
	{	
		// Deleting all cloth slots entities
		BaseLoadoutManagerComponent loadoutMan = BaseLoadoutManagerComponent.Cast(pUserEntity.FindComponent(BaseLoadoutManagerComponent));
		if(!loadoutMan)
			return;		
		
		IEntity ent0 = loadoutMan.GetClothByArea(LoadoutBackpackArea);
		IEntity ent1 = loadoutMan.GetClothByArea(LoadoutBootsArea);
		IEntity ent2 = loadoutMan.GetClothByArea(LoadoutHeadCoverArea);
		IEntity ent3 = loadoutMan.GetClothByArea(LoadoutJacketArea);
		IEntity ent4 = loadoutMan.GetClothByArea(LoadoutPantsArea);
		IEntity ent5 = loadoutMan.GetClothByArea(LoadoutVestArea);
		IEntity ent6 = loadoutMan.GetClothByArea(LoadoutBinocularsArea);
		IEntity ent7 = loadoutMan.GetClothByArea(LoadoutCoverArea);
		IEntity ent8 = loadoutMan.GetClothByArea(LoadoutGooglesArea);
		IEntity ent9 = loadoutMan.GetClothByArea(LoadoutWatchArea);
		
		loadoutMan.Unwear(ent0);
		loadoutMan.Unwear(ent1);
		loadoutMan.Unwear(ent2);
		loadoutMan.Unwear(ent3);
		loadoutMan.Unwear(ent4);
		loadoutMan.Unwear(ent5);
		loadoutMan.Unwear(ent6);
		loadoutMan.Unwear(ent7);
		loadoutMan.Unwear(ent8);
		loadoutMan.Unwear(ent9);					

		// Deleting all weapon slots entities
		BaseWeaponManagerComponent weaponMan = BaseWeaponManagerComponent.Cast(pUserEntity.FindComponent(BaseWeaponManagerComponent));	
		if(!weaponMan)
			return;	
		
		array<IEntity> outWeapons = {};
		weaponMan.GetWeaponsList(outWeapons);
		
		foreach (IEntity weaponEntity : outWeapons)
		{
			SCR_EntityHelper.DeleteEntityAndChildren(weaponEntity);
		}
		
	}		
};

Details

Severity
Crash
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
Windows 10 Pro 21H2 (19044.2006)
Category
General
Steps To Reproduce

Open atached project.
Go to world editor.
Start game and excute the user action on the Medical Box.
After all items are deleted exit the game.
Go to Script Editor
Compile
Crash

The code that des that seems to be the "// Deleting all cloth slots entities" part.

Video
https://youtu.be/lJsf-MqcrFk

Event Timeline

Piloto_Spyke edited Steps To Reproduce. (Show Details)
Geez closed this task as Resolved.Dec 22 2022, 12:29 PM
Geez claimed this task.
Geez added a subscriber: Geez.

Hello Piloto_Spyke.
The problem has been resolved internally and the fix will appear in one of the upcoming updates.
Regards,
Geez