REGoth-bs icon indicating copy to clipboard operation
REGoth-bs copied to clipboard

REGoth crashes due to not yet loaded resources

Open mworchel opened this issue 6 years ago • 2 comments

Steps to reproduce:

  1. Use current master (2d71e247cec81dac3fdaaa365f114d0ebc9c73fb)
  2. Load ADDONWORLD.ZEN (Gothic 2) in the world viewer and make sure the init scripts are run (world->runInitScripts();)
  3. Quit the world viewer
  4. Start the world viewer without deleting the cache

An exception with the description Trying to access a resource that hasn't been loaded yet. will be raised in the function ModelScriptFile::_buildMeshesByNameMap by the call bs::String nameUpperCase = m->getName();.

The exception is most likely a sign that resources are accessed which are not saved as part of the prefab. The "hasn't been loaded yet" is a bit misleading here, as those resources will never be loaded.

The display name of the affected ModelScriptFile is "SCAVANGER" if that helps.

mworchel avatar May 18 '19 15:05 mworchel

Can you try using the AI branch? I did a lot of work on rtti for worlds which has the init scripts ran because it didn't work.

ataulien avatar May 18 '19 17:05 ataulien

It seems like this happens only on some ModelScriptFile-resources, SCAVANGER being one of them. If you just ignore those during loading, the world loads fine. I'll commit the workaround, but we should look into what's different for those model script files.

ataulien avatar May 22 '19 15:05 ataulien