Skip to content

Deregister the player before loading a new one

Evil Eye requested to merge Assumeru/openmw:unsubscribe into master

This fixes a minor issue that can cause two player refnums to exist in the registry at the same time.

I don't think this can happen for new saves since the player is initialized so early that it's guaranteed to get the first refnum, meaning the old and new refnum are identical. It's very easy to trigger an error by loading a pre-Lua save and then calling debug.reloadLua() though.

The fact that the player's ptr gets registered before we even show the main menu is kinda dodgy, but not likely to be worth fixing.

Merge request reports