OverlayInterface: Add free uid back to m_freeIndices. - #8
Open
ZenoArrows wants to merge 1 commit into
Open
ZenoArrows wants to merge 1 commit into
ZenoArrows wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a fix for a bug brought up in a fork: https://github.com/nopse0/f4ee-patched
The basic issue is that while
OverlayInterface::RemoveAlladds each UID back tom_freeIndicesthis step is skipped when removing a single overlay usingOverlayInterface::RemoveOverlay.Bug description in the fork
There is a nasty bug in the
OverlayInterface::RemoveOverlayfunction. The UID of the removed overlay is not added to the list "m_freeIndices". This has the effect that if the list of free indices is empty and you add two overlays to an actor, and then remove the first one, that after that, all overlays you add will get the UID of the second one and overwrite it. It' s impossible after that to increase the number of overlays a npc has. This bug makes it practically impossible to use overlays with a limited duration with AAF (or NAF+NAFBridge). If there are other known bugs in the LooksMenu overlay f4ee.dll, feel free to send merge requests.Example:
After this, all overlays you add will have the value of uid2 and overwrite the second:
=> uid3 = uid4 = ... = uidn = uid2
This is because the GetNextUID() function looks like this:
So in
RemoveOverlay()the removed UID must be added to the list of free indices (otherwise you get the error described above) !!!!