Open maciello opened 1 year ago
This one is scary... It's probably not intended to be able to signal from other threads in a non deferred way like this is. SignalEntitiesDeferred seems correct here (It just defers the signal with PushCommand) and in the worst case this delays things by a frame. If things start acting weird inside of a single frame we can try something nicer...
I have a similar issue on Windows 11 running in PIE when shooting lots of balls. It fails the ensure check LocalState.GetWriterThreadId() == CurrentThreadId at line 585 of MTAccessDetector.h
It happens when you shoot a lot of projectiles in short succession.
Crash Log:
changing the line from:
Context.GetMutableSubsystem<UMassSignalSubsystem>()->SignalEntities(MassSample::Signals::OnGetHit, Entities);
to:
Context.GetMutableSubsystem<UMassSignalSubsystem>()->SignalEntitiesDeferred(Context, MassSample::Signals::OnGetHit, Entities);
kinda makes it not crash but I don't know if it affects anything else negatively.