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

Vessel(name) always fails to find the current cpu vessel. #1565

Closed
Dunbaratu opened this issue Mar 25, 2016 · 0 comments
Closed

Vessel(name) always fails to find the current cpu vessel. #1565

Dunbaratu opened this issue Mar 25, 2016 · 0 comments
Labels
bug Weird outcome is probably not what the mod programmer expected.

Comments

@Dunbaratu
Copy link
Member

If ship:name is "foo", and you try to call vessel("foo")., you get an exception that there is no such vessel called "foo", when clearly there is one - your own.

It seems that the candidate vessels that the Vessel(...) constructor function chooses from is the list of all vessels other than the current vessel.

I think it might be using the same list of vessels that LIST TARGETS uses, and scanning through that list (I haven't looked at the code to know for sure - I'm just reporting this bug and moving on). It might make sense why LIST TARGETS doesn't list the current vessel - you can't target your own ship. But you should be able to access it by its name.

(Note, as an aside, while it might make sense why the current vessel isn't a candidate among the LIST TARGETS, that does also raise the issue that if that's the case then we are still missing a means to actually really list all the vessels. Also, I never liked that LIST TARGETS lists vessels. By name it sounds like it should list all potential targets, meaning vessels, bodies, and docking ports, but that may be a different issue to raise separately.)

@Dunbaratu Dunbaratu added the bug Weird outcome is probably not what the mod programmer expected. label Mar 25, 2016
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

No branches or pull requests

1 participant