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 #2495 body ikos targetable #2501

Merged
merged 2 commits into from
Apr 28, 2019

Conversation

Dunbaratu
Copy link
Member

Fixes #2495

The term "IKOSTargetable" was accidentally deleted from the declaration header of class BodyTarget by 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, BodyTarget values no longer allowed themselves to be thusly casted.

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.
@Dunbaratu Dunbaratu merged commit ffc8757 into KSP-KOS:develop Apr 28, 2019
@Dunbaratu Dunbaratu added the bug Weird outcome is probably not what the mod programmer expected. label May 1, 2019
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.

kOS 1.1.7, KSP 1.6.1 or 1.7 : No longer being able to set the target to a BODY
1 participant