[Scummvm-devel] I Have No Mouth - Character disappears on loading a save

Willem Jan Palenstijn wjp at usecode.org
Tue Aug 19 15:03:19 CEST 2014


On Sun, Aug 17, 2014 at 11:06:48AM +0000, Willem Jan Palenstijn wrote:
> Hi all,
> 
> A possible cause for this issue is _scene->_currentProtag not being initialized when starting a new game.
> 
> Back in 2007 we apparently worked around that by fixing up invalid protagonist IDs in the loading code. I'm not sure if this is what happened here, but if this uninitialized protagonist ID happened to be valid but incorrect, this fixup would change the location of the protagonist.
> 
> Could any SAGA devs offer any insights or a good suggestion on how/where to initialize _currentProtag?

Less feedback than I had hoped, so let me offer two suggestions myself.


There seem to be at least 3 ways in which the protagonist is tracked. A kProtagonist flag, the Actor::_protagist pointer stored in the (very confusingly named) Actor object, and the Scene::_currentProtag storing an object ID.

I'm not at all sure why Scene::_currentProtag exists, as it seems to be entirely unused except for swapping (and breaking!) the current protagonist when loading a game, and on top of that it is uninitialized.

The least invasive approach would probably be initializing Scene::_currentProtag to Actor::_protagonist->_id after loading the scene.

It may be better to remove _currentProtag entirely, and just save Actor::_protagonist->_id directly.


Opinions? I'm not at all familiar with SAGA, so I may very well be missing a reason for these things. (Possibly related to ITE rather than IHNM; no idea.)


-Willem Jan




More information about the Scummvm-devel mailing list