So here's the basics of what's happening: the images that these server-push events use are installed as "virtual images", built from data shipped with the event rather than data read from an image file on your computer. It looks like the server events install code that re-installs these virtual images every time you load your character; the problem is that sometimes the game draws the map before those virtual images have been installed, so the Plumpkin image, for instance, isn't there when the map tries to draw the Plumpkin object.
To attempt to fix this, here's what we do when you enter a level (and in theory when you load a game, but that doesn't always seem to work):
- In core.display.loadImage(), we make a note of any image we try to load that is missing.
- In core.display.virtualImage(), we check the notes from above to see if we already tried and failed to load this image, and make a note if we did.
- Then we check every object, actor and terrain on the map to see if it uses any of the virtual images we failed to load, and redraw it if it does.
[And for now I'm categorizing this as a bugfix addon, so I'm reluctant to add it to ZOmnibus or ZOmnibus Lite, since we'd have to claw it back out if the bug is fixed later.]
[Implementation notes:
Code: Select all
Hooks:
ToME:load [to add some hooks into the image-loading code]
ToME:runDone [to attempt to fix current level when we load game]
Superload:
mod.class.Player:
onEnterLevelEnd() [to attempt to fix level on entry]