Fixes #2495 body ikos targetable#2501
Merged
Dunbaratu merged 2 commits intoKSP-KOS:developfrom Apr 28, 2019
Merged
Conversation
The word "IKOSTargetable" was accidentally deleted from the declaration header of class BodyTarget by my PR KSP-KOS#2460. The SET TARGET command has a check to see if the value being set is an actual target object or just a string name that needs to be looked up. That check was based on seeing if the value could be cast to IKOSTargetable or not. When that was accidentally removed from BodyTarget's header, it broke that check.
I had inserted a check to throw an exception if you try to SET TARGET to an illegal body, one the game won't allow because you currently orbit it. In retrospect, that removes a feature people might have been using, which is that trying to set the target to your current SOI body is a roundabout way to unset the target (the game will refuse the attempt and deselect the target, but the kOS script would be fine with it and wouldn't crash). Changing that into an exception means previously working code could break, so I removed the check again.
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.
Fixes #2495
The term "IKOSTargetable" was accidentally deleted from the declaration header of class
BodyTargetby my PR #2460. This puts it back.It caused the bug because of a place in VesselUtils.SetTarget() where it tries to cast the target value to
IKOSTargetable, and with that term removed from the header,BodyTargetvalues no longer allowed themselves to be thusly casted.