Page MenuHomeFeedback Tracker

Access violation. Illegal read by 0x140bba89d at 0x0 when calling SCR_GetInUserAction::PerformAction on script-spawned vehicle
Assigned, NormalPublic

Description

I have a simple setup using the CentralEconomy mod for spawners. I've set up some custom vehicle spawners for CE that were working perfectly fine prior to the most recent update, this video shows one of these spawned vehicles working fine the day prior to the update:
https://youtu.be/YjSoOBsXzsk?t=281

I don't think I made any changes to my mod in between it working and breaking. I recorded that video before going to bed, when I woke up I saw update was released, booted up WB and went to test things and ran into this getting into a vehicle:

Reason: Access violation. Illegal read by 0x140bba89d at 0x0


Class:      'SCR_GetInUserAction'
Function: 'PerformAction'
Stack trace:
Scripts/Game/UserActions/SCR_GetInUserAction.c:44 Function PerformAction
Scripts/Game/Interactions/SCR_InteractionHandlerComponent.c:232 Function DoProcessInteraction
Scripts/Game/Interactions/SCR_InteractionHandlerComponent.c:721 Function OnPostFrame

The line in question SCR_GetInUserAction.c:44 has a few calls to internal script/game/engine methods that can't be modded (GetInVehicle, GetRevelvantDoor) so I think this is a bug introduced in the latest update:

if (!compartmentAccess.GetInVehicle(pOwnerEntity, targetCompartment, false, GetRelevantDoorIndex(pUserEntity), ECloseDoorAfterActions.RETURN_TO_PREVIOUS_STATE, false))

If I change the teleport flag (3rd arg) to true it seems to fix the crash but then breaks other stuff like the enter animation and interior action contexts:

if (!compartmentAccess.GetInVehicle(pOwnerEntity, targetCompartment, true, GetRelevantDoorIndex(pUserEntity), ECloseDoorAfterActions.RETURN_TO_PREVIOUS_STATE, false))

If I spawn the same vehicle in through GM mode my character can enter and exit fine. It's just vehicles created via script seem to be breaking on GetInUserAction.

Happy to provide mdmp and a minimal repro case enfusion project via Discord

Details

Severity
Crash
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
General
Steps To Reproduce
  1. Spawn a vehicle in via script (e.g. add a "VEHICLES" category and UAZ to loot table config of CentralEconomy mod, add a lootspawner prefab set to only spawn VEHICLES category)
  2. Try to get into the vehicle
Additional Information

Same setup working fine before latest update (WB publish fix) as per video

Event Timeline

wyqydsyq created this task.Feb 28 2025, 7:15 PM

Update:

The issue seems related to my script-spawned vehicles being added as a child node of the spawner entity (so CE can track removal and enable spawning at that point again).

If I remove lootSpawn.AddChild(newEnt, -1, EAddChildFlags.NONE); from the spawner logic it solves the issue of access violation error upon getting in vehicle. It appears adding the vehicle entity as a child of another entity causes some memory management issue that surfaces when triggering GetInUserAction.

I think this seems to be a regression or undisclosed breaking change, AFAIK there isn't any explained technical reason we shouldn't be able to have a vehicle entity as a child of another entity and this seemed to be working just fine prior to the latest update.

Geez changed the task status from New to Reviewed.Mar 3 2025, 1:58 PM
Geez changed the task status from Reviewed to Assigned.Mar 3 2025, 2:01 PM