Skip to content

Release 0.0.6

Choose a tag to compare

@Alexander-Aue-Johr Alexander-Aue-Johr released this 28 May 20:35
· 7 commits to main since this release

Fix stale cached weapon items after scene content disposal

Weapons cached from scene-owned item assets could survive in the item cache even
after the SharedContentManager had disposed their graphics resources. When the
same weapon was requested later, the cache still returned the old Item instance,
but its model, textures, or other graphics assets could already be disposed,
causing crashes when the item was used or rendered.

Remove disposed weapon items from the cache instead of keeping stale references.

Also keep track of weapon asset names separately. Items that originate from
character templates are still first loaded through the scene content manager, as
before. However, if such an item is picked up and carried into a later scene, the
previous scene may unload and dispose the original asset. When the weapon is
needed again and no valid cached instance remains, reload it through the
PlayState content manager instead, so player-carried weapons can survive scene
transitions without being unloaded by the next GameScene cleanup.