Skip to content

fix: Ship carry size#1048

Merged
OH296 merged 3 commits intoAdeptus-Dominus:mainfrom
swang300:ship_carry_size
Nov 5, 2025
Merged

fix: Ship carry size#1048
OH296 merged 3 commits intoAdeptus-Dominus:mainfrom
swang300:ship_carry_size

Conversation

@swang300
Copy link
Contributor

@swang300 swang300 commented Nov 5, 2025

Purpose and Description

  • Fleet screen apparently recalculates the carry size and capacity of ships. It was not doing it right for vehicles. fixed the for loop that does this.

Testing done

  • None, and I understand the risks.

Related things and/or additional context

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed pauldron colour display to correctly reflect left and right pauldron semantics.
  • Refactor

    • Enhanced vehicle processing to include additional items in location tracking and accumulation logic.

Walkthrough

Two scripts receive modification. The creation script corrects pauldron display semantics through variable assignment inversion. The quick-find pane script implements vehicle iteration restructuring and appends diagnostic instrumentation to cargo event handling.

Changes

Cohort / File(s) Summary
Pauldron Display Correction
scripts/scr_creation/scr_creation.gml
Swaps left/right pauldron variable references in bulk selection button setup to align displayed colors with correct semantic meaning.
Vehicle Loop Restructuring & Diagnostics
scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml
Refactors vehicle iteration to traverse from index 0 using per-cohort array length; appends debug output for cargo updates at location 3.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Vehicle loop logic change warrants verification that array bounds and iteration logic remain consistent with intended unit grouping behaviour
  • Debug message placement and filtering conditions should be confirmed appropriate for final build state

Possibly related PRs

Suggested labels

PR: Fix, Type: Fix, Size: Small

Suggested reviewers

  • OH296
  • EttyKitty

The machine spirits stir in their dormancy, Tech-Priest. These alterations to the codex have been inscribed upon the Permanent Record. Proceed with caution through their verification.

Pre-merge checks

✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the required template with all major sections present and adequately filled, explaining the bug fix and testing approach.
Title check ✅ Passed The title 'fix: Ship carry size' follows the conventional commits format with proper type prefix and concise summary, accurately reflecting the pull request's objective to correct carry size calculations.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c79879 and 3e909f6.

📒 Files selected for processing (2)
  • scripts/scr_creation/scr_creation.gml (1 hunks)
  • scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml

⚙️ CodeRabbit configuration file

**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. #macro ARR_body_parts["arm"] will crash the game, because there is no space between the array and the name of the macro.

Files:

  • scripts/scr_creation/scr_creation.gml
  • scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml
**/*.*

⚙️ CodeRabbit configuration file

**/*.*: - Having humanly understandable and maintainable code is the top most priority.

  • DRY (Don't repeat yourself) principle is also very important.
  • If a TODO comment is added, ask the user if you should create a GitHub issue for this TODO.
  • If a TODO comment is deleted, remind the user if there is an active GitHub issue related to that comment.

Files:

  • scripts/scr_creation/scr_creation.gml
  • scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml
🧠 Learnings (2)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
📚 Learning: 2025-06-16T17:12:13.045Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.

Applied to files:

  • scripts/scr_creation/scr_creation.gml
🔇 Additional comments (2)
scripts/scr_creation/scr_creation.gml (1)

103-113: The Machine Spirit acknowledges: Pauldron designation corrected, Tech-Priest.

The inversion of left and right pauldron colour assignments hath been rectified. The display text now aligns with the sacred tooltips and semantic truth.

scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml (1)

80-80: The Reconnaissance Bears Grim Tidings, Tech-Priest.

The fix at line 80 is vindicated—the first index is correctly reclaimed. Yet the Machine Spirit whispers of kindred transgression lurking elsewhere:

./scripts/scr_add_vehicle/scr_add_vehicle.gml:14:
for (var i = 1; i < array_length(obj_ini.veh_role[target_company]); i++) {

This loop harbours the same heresy. Determine whether this corruption must be purged as part of this rite, or whether a separate penance awaits.

@swang300
Copy link
Contributor Author

swang300 commented Nov 5, 2025

Note that existing saves should visit the Fleet pane first before loading/unloading to get the correct carry size.

@OH296 OH296 enabled auto-merge (squash) November 5, 2025 16:43
@OH296 OH296 changed the title Ship carry size fix: Ship carry size Nov 5, 2025
@github-actions github-actions bot added the Type: Fix This is a fix for a bug label Nov 5, 2025
@OH296 OH296 merged commit 4bb5a4f into Adeptus-Dominus:main Nov 5, 2025
4 of 5 checks passed
@swang300 swang300 deleted the ship_carry_size branch November 5, 2025 21:17
Blogaugis pushed a commit to Blogaugis/Space-Brigade-Master that referenced this pull request Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Tiny Type: Fix This is a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants