Jypeli-JYU / Jypeli

A simple educational C# game programming library built on top of Silk.NET.
26 stars 4 forks source link

Fix bug in SynchronousList.Update #9

Closed Anttifer closed 4 years ago

Anttifer commented 4 years ago

Destroyed GameObjects were denied their very last update, which caused their (destroyed) children to become effectively unreachable and never removed.

(The logic and sequencing of game state updates is rather convoluted with lots of events triggered, so there may still be further bugs. However, this change fixes at least some of them, and should not be able to cause any new ones - after all, this just lets the to-be-removed items to update their state one last time, allowing their children to be recursively removed.)

roeyskoe commented 4 years ago

This does not seem to cause problems with existing game code (ie. if players weapon was manually destroyed).