Megafunk / MassSample

My understanding of Unreal Engine 5's experimental ECS plugin with a small sample project.
MIT License
681 stars 112 forks source link

Errors on every projectile-bounce leading to a crash in Linux #54

Closed maciello closed 11 months ago

maciello commented 1 year ago

It happens every time a Projectile bounces. Crash happens when shooting a lot of projectiles in short succession.

tested on UE versions: 5.1.1 + 5.2

File: Plugins/MassCommunitySample/Source/MassCommunitySample/Common/Processors/MSOctreeProcessors.cpp

Line:42:

...
void UMSProjectileHitObservers::Execute(FMassEntityManager& EntityManager, FMassExecutionContext& Context)
{
    Context.SetFlushDeferredCommands(true);

    CollisionHitEventQuery.ForEachEntityChunk(EntityManager, Context, [&](FMassExecutionContext& Context)
    {...

Removing(/Commenting) the line fixes the errors.

...
void UMSProjectileHitObservers::Execute(FMassEntityManager& EntityManager, FMassExecutionContext& Context)
{
    //Context.SetFlushDeferredCommands(true);

    CollisionHitEventQuery.ForEachEntityChunk(EntityManager, Context, [&](FMassExecutionContext& Context)
    {...
Megafunk commented 11 months ago

I disabled flushing these guys for now (same fix here)