Irevol / minetest-citadel

A minetest game
Other
3 stars 1 forks source link

Sepia HUD ID stored across sessions #16

Closed Warr1024 closed 8 months ago

Warr1024 commented 8 months ago

When you first play, a "sepia HUD" is created for the new player, and the ID is stored in mod storage.

However, if you quit the game, and then later try to start it up again to resume, no sepia HUD is registered for the player (since it's not a "new" player, it's an existing player rejoining) and thus the stored sepia_hud_id in mod storage points to some arbitrary HUD other than the sepia one. This could be a HUD used for the flash fading effect, so that when you change eras, the smooth flash effect is momentarily interrupted, and the sepia effect is gone.

Wuzzy2 commented 8 months ago

Storing a HUD ID in mod storage is completely nonsensical. HUD IDs are relevant for the current game session only so the solution is to never store them in mod storage and just create a new HUD element once it's needed.