fix: Repair demon summon ship battle - #1490
Merged
Merged
Conversation
The roster scan probed slots 1 through 300 for each of 11 companies regardless of the company's bounds. After Adeptus-Dominus#1414 removed the obj_ini.name sentinel, probes past the end of a roster reached fetch_unit and reported an index-out-of-bounds error for every invalid slot. The scan now iterates each stored company over its valid zero-based bounds, which also lets the first marine in each company join the battle. The summon branch also skipped the normal combat-scene handoff, so map instances remained active over the battle and the shared formation columns could retain the previous battle's values. It now performs the scene handoff before creating combat, applies its configured formation before building the roster, and closes the Librarium once the battle is built.
Contributor
There was a problem hiding this comment.
2 issues found across 2 files
Confidence score: 5/5
- In
scripts/scr_ship_battle/scr_ship_battle.gml, the newokayandsofarlocals violate the project’s non-loop variable naming convention; rename them to_okayand_sofarand update their references.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/scr_ship_battle/scr_ship_battle.gml">
<violation number="1" location="scripts/scr_ship_battle/scr_ship_battle.gml:12">
P2: Custom agent: **Code Quality Review**
The added `sofar` local violates the required `_` prefix for non-loop `var` variables. Rename it to `_sofar` and update its references.</violation>
<violation number="2" location="scripts/scr_ship_battle/scr_ship_battle.gml:18">
P2: Custom agent: **Code Quality Review**
The added `okay` local violates the required `_` prefix for non-loop `var` variables. Rename it to `_okay` and update its references.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
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.
Summary by cubic
Fixes the demon summon ship battle, which previously crashed with index-out-of-bounds errors during roster building and left map instances active over the battle.
Written for commit fd20c2d. Summary will update on new commits.