You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've found a bug that happen after using/spawning the SplashExplosion entity in the world and trying to save the game.
I'm making a game with a gun that create an explosion around the player, the gun simply fire that spell class, but I discovered that after the player shot at least one bullet from the gun the game crashes when the player try to save the game.
What is happening?
The crash is caused by a recursive error when serializing the explosion spell class.
The player has a reference somewhere that link to the explosion and the explosion store a reference of the player in the owner property, when the game try to save by exiting the game or entering the next level it will call the object serializer.
The object serializer will save the explosion, then go to the player, the go to the explosion again and do this cyclically until the game crashes because of an endless recursion.
Possible solution
I solved the problem by adding transient to that property, very easy.
It took a painful weekend to discover this thing, the game just started to crash and I was in panic until I finally figured out, so I think is important to be aware of this and my proposal as a solution should not be a problem to the project.
The text was updated successfully, but these errors were encountered:
Hi, I've found a bug that happen after using/spawning the SplashExplosion entity in the world and trying to save the game.
I'm making a game with a gun that create an explosion around the player, the gun simply fire that spell class, but I discovered that after the player shot at least one bullet from the gun the game crashes when the player try to save the game.
What is happening?
The crash is caused by a recursive error when serializing the explosion spell class.
The player has a reference somewhere that link to the explosion and the explosion store a reference of the player in the owner property, when the game try to save by exiting the game or entering the next level it will call the object serializer.
The object serializer will save the explosion, then go to the player, the go to the explosion again and do this cyclically until the game crashes because of an endless recursion.
Possible solution
I solved the problem by adding
transient
to that property, very easy.line
Conclusion
It took a painful weekend to discover this thing, the game just started to crash and I was in panic until I finally figured out, so I think is important to be aware of this and my proposal as a solution should not be a problem to the project.
The text was updated successfully, but these errors were encountered: