Fix some crashes when running without globals and update structures.
Update the version to v0.40.05
Fix SC_WORLD_LOADED/UNLOADED now that loading and saving takes many frames.

During the loading or saving screen, consider the map and world as not
loaded, because they are likely only partially valid. This fixes errors
from the log-region script.