Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2782 by moving msg hooks around. #2783

Merged

Conversation

Dunbaratu
Copy link
Member

@Dunbaratu Dunbaratu commented Oct 23, 2020

Fixes #2782
The best fix I could think of was to maintain a list of which
vessels' autopilots wanted to have the message on versus which
do not. That avoids the problem of one vessel turning off the
flag when another vessel wanted it on. Now there's a
HashSet of all the vessels that want the flag on. As long as
there's at least one vessel that wants it on, it stays on. Only
when all vessels want it off does it turn off. Also,
the vessels can turn it off in their remove hooks code that
happens when their autopilots get destructed, thus avoiding the
scene change bug that the issue talked about.

The best fix I could think of was to maintain a list of which
vessels' autopilots wanted to have the message on versus which
do not.  That avoids the problem of one vessel turning off the
flag when another vessel wanted it on.  Now there's a
HashSet of all the vessels that want the flag on.  As long as
there's at least one vessel that wants it on, it stays on.  Only
when all vessels want it off does it turn off.  Also,
the vessels can turn it off in their remove hooks code that
happens when their autopilots get destructed, thus avoiding the
scene change bug that the issue talked about.
@Dunbaratu Dunbaratu added the bug Weird outcome is probably not what the mod programmer expected. label Oct 23, 2020
@Dunbaratu Dunbaratu merged commit 722bd5e into KSP-KOS:develop Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Weird outcome is probably not what the mod programmer expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

messages for SAS conflict and suppress Autopilot stay after leaving scene
1 participant