Repository navigation
Conversation
Returns the missile tube state (empty/loading/loaded/unloading/firing) and the weapon type involved. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #1975.
Cause
Scripts can read which weapon is loaded (
getWeaponTubeLoadType), but that returns nothing while a tube is loading or unloading, and there is no way to read the tube state (empty/loading/loaded/unloading/firing). The state was already exposed ascomponents.missile_tubes[n].state, just not through a documented getter.Change
scripts/api/entity/spaceship.lua: newEntity:getWeaponTubeStatus(index)besidegetWeaponTubeLoadType. Returns two values: the state string ("empty","loading","loaded","unloading","firing") and the weapon type string ("none"when empty). Out-of-range index or no tubes returns no value (same as the neighbouring getters). Lua only, no C++. Docstring uses the existing---format.You noted in the issue that the ECS branch covers this, and it does through
components.missile_tubes[n].state. This only adds a documented getter besidegetWeaponTubeLoadType; if the component access is the intended API, feel free to close this.Checks
scripts/**.lua(the engine's own Lua): 0 failed.Not tested
"firing"state never observed (homing fires instantly; only HVLI's staggered fire shows it). Value comes from the existing enum conversion insrc/script/enum.h.getWeaponTubeStatusvs...State) is my choice; maintainer may prefer another.src/components/missiletubes.h; neither touchesspaceship.lua, so no conflict expected.🤖 Generated with Claude Code