Incorrect shared fragment hashing in Mass system

Summary

The hashing logic used by FMassEntityManager::GetOrCreateConstSharedFragment doesn’t take into account SoftObjectPtr properties when stored objects are not loaded.

What Type of Bug are you experiencing?

Framework

Steps to Reproduce

  1. Create a shared fragment.
  2. Create a trait with said fragment.
  3. Add the fragment to the build context using mentioned method.
  4. Create 2 entity DAs that reference different object in SoftObjectPtr.
  5. Start PIE with debugger attached, and breakpoint set in BuildTemplate method.

Expected Result

The shared fragments that differ only in SoftObjectPtr properties are correctly marked as different instances.

Observed Result

The mass uses already existing shared fragment, instead of creating a new version with correct SoftObjectPtr.

Affects Versions

5.5

Platform(s)

Windows

Additional Notes

I’d like to suggest reverting the change that made GetOrCreateConstSharedFragmentByHash private in 5.8