Crash when spawning actors in 20 player net game
Getting this crash when spawning actors in a 20 player network game test. This code runs many times per mininute in the game, so does not fail every time, and has never crashed when testing networked in the editor. Due to the way the build is being made, it's hard to debug any of these lines that are in the engine code, only 2 of the lines i the below stack are in the code written for the game.
The code in question was this....
So the only things i can see is...
GetWorld() - so this can return null? is this supposed to be checked, if so, there are places in the engine itself where this is never checked. It seems it can be null when the world is shutting down or when the object is being destroyed, but i verified from the crash dump that neither of these situations were happening.
The issue is WeaponSoundFX_Template and not GetWorld, you need to dereference TSubClassOf to get the UClass it may or may not have.
answered May 22 '19 at 02:54 PM
Thanks for the answer, but without changing any code and stepping through this code in the editor shows that the dereference is implicitly happening anyway....
Which is good, as if you need to dereference this to use it and it silently compiles without any errors or warnings, that would be really bad.
answered May 22 '19 at 03:57 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here