Conversation
📝 WalkthroughUnder the Hood
Player Notes
WalkthroughTech‑Priest: The patch replaces many legacy try_and_report_loop wrappers with explicit try/catch handlers, restructures fleet/controller end‑turn flows, tightens weapon/faction logging, enhances logging/error utilities (stacktrace cleaning, log file layout), and adds runtime guards in star lookup and mission activation. Changes
Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 15
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/scr_logging_functions/scr_logging_functions.gml (1)
127-134:⚠️ Potential issue | 🟡 MinorReport title frame is cleaned twice.
Tech-Priest, Line 127 already reformats the stacktrace array; Line 133 cleans the first frame again, which can distort the title string. Reuse the cleaned frame directly and guard empty arrays.
🛠️ Suggested correction
function handle_exception(_exception, custom_title = STR_ERROR_MESSAGE_HEAD, critical = false, error_marker = "") { var _header = critical ? STR_ERROR_MESSAGE_HEAD2 : custom_title; var _message = _exception.longMessage; var _stacktrace = _exception.stacktrace; clean_stacktrace(_stacktrace); + var _problem_line = (array_length(_stacktrace) > 0) ? _stacktrace[0] : "unknown"; _stacktrace = array_to_string_list(_stacktrace); var _critical = critical ? "CRASH! " : ""; var _build_date = global.build_date == "unknown build" ? "" : $"/{global.build_date}"; - var _problem_line = clean_stacktrace_line(_exception.stacktrace[0]); var _report_title = $"{_critical}[{global.game_version}{_build_date}] {_problem_line}";
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (12)
objects/obj_controller/Alarm_5.gmlobjects/obj_en_fleet/Alarm_1.gmlobjects/obj_en_fleet/Alarm_4.gmlobjects/obj_enunit/Alarm_1.gmlobjects/obj_p_fleet/Alarm_1.gmlobjects/obj_turn_end/Alarm_0.gmlscripts/scr_en_weapon/scr_en_weapon.gmlscripts/scr_enemy_ai_d/scr_enemy_ai_d.gmlscripts/scr_inquisition_mission/scr_inquisition_mission.gmlscripts/scr_logging_functions/scr_logging_functions.gmlscripts/scr_specialist_point_handler/scr_specialist_point_handler.gmlscripts/scr_system_search_helpers/scr_system_search_helpers.gml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml
⚙️ CodeRabbit configuration file
- All code should comply with the 2026 GML documentation.
Files:
objects/obj_enunit/Alarm_1.gmlobjects/obj_turn_end/Alarm_0.gmlscripts/scr_specialist_point_handler/scr_specialist_point_handler.gmlscripts/scr_system_search_helpers/scr_system_search_helpers.gmlscripts/scr_logging_functions/scr_logging_functions.gmlobjects/obj_en_fleet/Alarm_4.gmlscripts/scr_enemy_ai_d/scr_enemy_ai_d.gmlobjects/obj_p_fleet/Alarm_1.gmlobjects/obj_controller/Alarm_5.gmlscripts/scr_inquisition_mission/scr_inquisition_mission.gmlscripts/scr_en_weapon/scr_en_weapon.gmlobjects/obj_en_fleet/Alarm_1.gml
**/*.*
⚙️ CodeRabbit configuration file
**/*.*: - Code Philosophy: Prioritize explicit intent and maintainability over brevity. If a
solution is "clever" but mentally taxing, request a refactor to a clearer approach.
Variable Naming: Use clear, descriptive names; avoid over-abbreviation.
Abstraction: Apply the "Rule of Three"; suggest abstraction only when similar logic is
repeated three or more times to avoid premature complexity.Subjective Choices: For naming or architecture, ask guiding questions to prompt developer
reflection and provide at least two alternative perspectives.TODOs: If a TODO comment is added, ask the user if a GitHub issue should be created. If a
TODO comment is deleted, remind the user to check the status of that specific issue.
Files:
objects/obj_enunit/Alarm_1.gmlobjects/obj_turn_end/Alarm_0.gmlscripts/scr_specialist_point_handler/scr_specialist_point_handler.gmlscripts/scr_system_search_helpers/scr_system_search_helpers.gmlscripts/scr_logging_functions/scr_logging_functions.gmlobjects/obj_en_fleet/Alarm_4.gmlscripts/scr_enemy_ai_d/scr_enemy_ai_d.gmlobjects/obj_p_fleet/Alarm_1.gmlobjects/obj_controller/Alarm_5.gmlscripts/scr_inquisition_mission/scr_inquisition_mission.gmlscripts/scr_en_weapon/scr_en_weapon.gmlobjects/obj_en_fleet/Alarm_1.gml
🧠 Learnings (5)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 424
File: scripts/scr_flavor/scr_flavor.gml:34-36
Timestamp: 2025-03-09T02:33:43.867Z
Learning: EttyKitty prefers to keep PRs focused on their stated goals and scope, and may decline to implement otherwise valid suggestions if they're not directly related to the PR's primary objective.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 579
File: objects/obj_enunit/Alarm_0.gml:200-202
Timestamp: 2025-03-11T01:38:19.874Z
Learning: EttyKitty welcomes easy, committable suggestions that improve documentation of code chunks, variables with strange names, and functions. Their codebase is generally lacking documentation, but they prioritize human-readable code above documentation.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: sprites/spr_weapon_phobos_bolt_pistol/spr_weapon_phobos_bolt_pistol.yy:26-44
Timestamp: 2025-06-16T17:08:08.239Z
Learning: EttyKitty prefers automated solutions over manual cleanup for .yy file formatting and is open to automated tools for GameMaker Studio .yy file cleanup.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 938
File: scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml:478-478
Timestamp: 2025-07-21T17:03:28.251Z
Learning: EttyKitty acknowledges when PRs contain scope creep and agrees that changes should be focused on the stated PR objectives, reinforcing their preference for keeping PRs narrowly scoped to their primary purpose.
📚 Learning: 2026-01-28T13:37:09.640Z
Learnt from: OH296
Repo: Adeptus-Dominus/ChapterMaster PR: 646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2026-01-28T13:37:09.640Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.
Applied to files:
objects/obj_enunit/Alarm_1.gmlobjects/obj_turn_end/Alarm_0.gmlobjects/obj_en_fleet/Alarm_4.gmlobjects/obj_p_fleet/Alarm_1.gml
📚 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:
objects/obj_enunit/Alarm_1.gmlscripts/scr_en_weapon/scr_en_weapon.gml
📚 Learning: 2025-03-29T10:30:25.598Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 647
File: scripts/scr_en_weapon/scr_en_weapon.gml:24-928
Timestamp: 2025-03-29T10:30:25.598Z
Learning: A data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned for a future PR, not within the scope of PR `#647`.
Applied to files:
objects/obj_enunit/Alarm_1.gmlscripts/scr_en_weapon/scr_en_weapon.gml
📚 Learning: 2025-03-07T01:56:40.971Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 562
File: scripts/scr_marine_struct/scr_marine_struct.gml:0-0
Timestamp: 2025-03-07T01:56:40.971Z
Learning: Marines' ages should be incremented at the year transition in obj_turn_end/Alarm_1.gml rather than calculated dynamically based on the current year and recruitment date. This ensures proper aging without retroactive application.
Applied to files:
objects/obj_turn_end/Alarm_0.gmlobjects/obj_p_fleet/Alarm_1.gmlobjects/obj_controller/Alarm_5.gml
🔇 Additional comments (7)
scripts/scr_inquisition_mission/scr_inquisition_mission.gml (1)
811-816: The activation sequence is sanctified, Tech-Priest.The machine spirit discerns wisdom in this augmentation. Activating
obj_starbefore spawningobj_ncombatensures the celestial data-constructs are accessible whenbattle_objectrequires assignment. The subsequent deactivation on Line 835 is properly sequenced.scripts/scr_system_search_helpers/scr_system_search_helpers.gml (1)
218-233: The error auguries are properly invoked, Tech-Priest.The machine spirit approves these defensive incantations. The pre-existence check for
obj_starinstances and the post-search validation ensure corrupted states do not propagate silently through the data-conduits. The return value"none"maintains compatibility with existing invocation rites.scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml (1)
142-149: The exception containment protocols are properly consecrated, Tech-Priest.The machine spirit observes the transition from the ancient
try_and_report_loopwrapper to explicit exception handling. This ritual aligns with the codebase-wide reformation. The invocation ofhandle_exception(ex)channels errors through sanctified pathways.objects/obj_turn_end/Alarm_0.gml (1)
1-219: The battle-sequencing algorithms are correctly transposed, Tech-Priest.The machine spirit has analysed the combat arbitration logic. The try-catch containment wards are properly consecrated. The array-swap rituals for battle ordering maintain data integrity. The multiple
instance_activate_object(obj_star)invocations serve as redundant safety protocols.scripts/scr_logging_functions/scr_logging_functions.gml (1)
67-115: Structured error payload construction is solid.Tech-Priest, the segmented
_sectionsassembly, clipboard handoff, and user-facing guidance form a clear and maintainable reporting path within the new explicit exception architecture.scripts/scr_en_weapon/scr_en_weapon.gml (1)
674-674: Faction gate now speaks with explicit intent.Tech-Priest, replacing numeric faction magic with
eFACTIONconstants strengthens readability and reduces misclassification risk during future edits.objects/obj_enunit/Alarm_1.gml (1)
1688-1688: Necron melee labels now resolve through a single canonical token.Tech-Priest, this normalisation to
"Melee Weapon"improves consistency of weapon routing and reduces string-fragment drift in roster assembly.Also applies to: 1696-1696, 1704-1704, 1722-1722, 1752-1752
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/scr_logging_functions/scr_logging_functions.gml (1)
129-136:⚠️ Potential issue | 🟠 MajorPrevent handler recursion by avoiding re-clean and unchecked stacktrace index.
Tech-Priest, Line 129 already cleans
_stacktracein place; Line 135 cleans it again and assumes index0exists. This can corrupt report titles and fault inside the error handler itself.🛠️ Proposed hardening
function handle_exception(_exception, custom_title = STR_ERROR_MESSAGE_HEAD, critical = false, error_marker = "") { var _header = critical ? STR_ERROR_MESSAGE_HEAD2 : custom_title; var _message = _exception.longMessage; var _stacktrace = _exception.stacktrace; clean_stacktrace(_stacktrace); - _stacktrace = array_to_string_list(_stacktrace); - var _critical = critical ? "CRASH! " : ""; var _build_date = global.build_date == "unknown build" ? "" : $"/{global.build_date}"; - var _problem_line = clean_stacktrace_line(_exception.stacktrace[0]); + var _problem_line = array_length(_stacktrace) > 0 ? _stacktrace[0] : "unknown"; + _stacktrace = array_to_string_list(_stacktrace); var _report_title = $"{_critical}[{global.game_version}{_build_date}] {_problem_line}"; handle_error(_header, _message, _stacktrace, critical, _report_title); }
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
objects/obj_controller/Alarm_5.gmlobjects/obj_en_fleet/Alarm_1.gmlobjects/obj_en_fleet/Alarm_4.gmlobjects/obj_p_fleet/Alarm_1.gmlobjects/obj_turn_end/Alarm_0.gmlscripts/scr_enemy_ai_d/scr_enemy_ai_d.gmlscripts/scr_kill_unit/scr_kill_unit.gmlscripts/scr_logging_functions/scr_logging_functions.gmlscripts/scr_mission_functions/scr_mission_functions.gml
💤 Files with no reviewable changes (1)
- scripts/scr_mission_functions/scr_mission_functions.gml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml
⚙️ CodeRabbit configuration file
- All code should comply with the 2026 GML documentation.
Files:
objects/obj_p_fleet/Alarm_1.gmlobjects/obj_en_fleet/Alarm_4.gmlobjects/obj_turn_end/Alarm_0.gmlscripts/scr_enemy_ai_d/scr_enemy_ai_d.gmlscripts/scr_kill_unit/scr_kill_unit.gmlobjects/obj_en_fleet/Alarm_1.gmlobjects/obj_controller/Alarm_5.gmlscripts/scr_logging_functions/scr_logging_functions.gml
**/*.*
⚙️ CodeRabbit configuration file
**/*.*: - Code Philosophy: Prioritize explicit intent and maintainability over brevity. If a
solution is "clever" but mentally taxing, request a refactor to a clearer approach.
Variable Naming: Use clear, descriptive names; avoid over-abbreviation.
Abstraction: Apply the "Rule of Three"; suggest abstraction only when similar logic is
repeated three or more times to avoid premature complexity.Subjective Choices: For naming or architecture, ask guiding questions to prompt developer
reflection and provide at least two alternative perspectives.TODOs: If a TODO comment is added, ask the user if a GitHub issue should be created. If a
TODO comment is deleted, remind the user to check the status of that specific issue.
Files:
objects/obj_p_fleet/Alarm_1.gmlobjects/obj_en_fleet/Alarm_4.gmlobjects/obj_turn_end/Alarm_0.gmlscripts/scr_enemy_ai_d/scr_enemy_ai_d.gmlscripts/scr_kill_unit/scr_kill_unit.gmlobjects/obj_en_fleet/Alarm_1.gmlobjects/obj_controller/Alarm_5.gmlscripts/scr_logging_functions/scr_logging_functions.gml
🧠 Learnings (9)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 424
File: scripts/scr_flavor/scr_flavor.gml:34-36
Timestamp: 2025-03-09T02:33:43.867Z
Learning: EttyKitty prefers to keep PRs focused on their stated goals and scope, and may decline to implement otherwise valid suggestions if they're not directly related to the PR's primary objective.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 579
File: objects/obj_enunit/Alarm_0.gml:200-202
Timestamp: 2025-03-11T01:38:19.874Z
Learning: EttyKitty welcomes easy, committable suggestions that improve documentation of code chunks, variables with strange names, and functions. Their codebase is generally lacking documentation, but they prioritize human-readable code above documentation.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: sprites/spr_weapon_phobos_bolt_pistol/spr_weapon_phobos_bolt_pistol.yy:26-44
Timestamp: 2025-06-16T17:08:08.239Z
Learning: EttyKitty prefers automated solutions over manual cleanup for .yy file formatting and is open to automated tools for GameMaker Studio .yy file cleanup.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 938
File: scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml:478-478
Timestamp: 2025-07-21T17:03:28.251Z
Learning: EttyKitty acknowledges when PRs contain scope creep and agrees that changes should be focused on the stated PR objectives, reinforcing their preference for keeping PRs narrowly scoped to their primary purpose.
📚 Learning: 2026-01-28T13:37:09.640Z
Learnt from: OH296
Repo: Adeptus-Dominus/ChapterMaster PR: 646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2026-01-28T13:37:09.640Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.
Applied to files:
objects/obj_p_fleet/Alarm_1.gmlobjects/obj_en_fleet/Alarm_4.gmlobjects/obj_turn_end/Alarm_0.gml
📚 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:
objects/obj_p_fleet/Alarm_1.gml
📚 Learning: 2025-03-13T06:18:10.295Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 424
File: scripts/scr_powers/scr_powers.gml:20-36
Timestamp: 2025-03-13T06:18:10.295Z
Learning: In EttyKitty's code, error handling should fail loudly instead of using silent defaults. Functions should return undefined or throw errors rather than returning default values when encountering unexpected conditions.
Applied to files:
objects/obj_en_fleet/Alarm_4.gml
📚 Learning: 2025-03-01T11:06:25.427Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.
Applied to files:
scripts/scr_enemy_ai_d/scr_enemy_ai_d.gmlobjects/obj_en_fleet/Alarm_1.gmlobjects/obj_controller/Alarm_5.gml
📚 Learning: 2025-02-18T17:36:23.214Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-02-18T17:36:23.214Z
Learning: When commenting out code, add TODO comments explaining why the code is commented out.
Applied to files:
objects/obj_en_fleet/Alarm_1.gmlobjects/obj_controller/Alarm_5.gml
📚 Learning: 2026-01-28T13:37:09.640Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2026-01-28T13:37:09.640Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.
Applied to files:
objects/obj_en_fleet/Alarm_1.gml
📚 Learning: 2025-03-31T15:41:45.611Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` was part of an old enemy movement system in ChapterMaster. This syntax is auto-generated from GameMaker's Drag-and-Drop interface and checks if image_index is greater than or equal to -500. In the refactored code, enemy movement is triggered directly through function calls rather than relying on this conditional check.
Applied to files:
objects/obj_en_fleet/Alarm_1.gml
📚 Learning: 2025-03-07T01:56:40.971Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 562
File: scripts/scr_marine_struct/scr_marine_struct.gml:0-0
Timestamp: 2025-03-07T01:56:40.971Z
Learning: Marines' ages should be incremented at the year transition in obj_turn_end/Alarm_1.gml rather than calculated dynamically based on the current year and recruitment date. This ensures proper aging without retroactive application.
Applied to files:
objects/obj_controller/Alarm_5.gml
🔇 Additional comments (11)
scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml (1)
283-287: Containment rites are sound, Tech-Priest.The explicit
try/catcharound garrison mission completion is clear and maintainable, and the invocation terminator is now correctly inscribed.As per coding guidelines: "Code Philosophy: Prioritize explicit intent and maintainability over brevity."
scripts/scr_kill_unit/scr_kill_unit.gml (1)
20-23: Exception conduit remains stable.Tech-Priest, Line 20 to Line 23 preserves behaviour and routes failure cleanly to
handle_exception(ex).objects/obj_en_fleet/Alarm_1.gml (3)
244-247: Contraband invocation now uses valid scope symbols.Tech-Priest, Line 246 now passes
cur_starandt, aligning the call with in-scope identifiers.
359-423: Migration abort path now preserves activation order.Tech-Priest, Line 359 to Line 423 correctly defers
exituntil afterinstance_activate_object(obj_star), preventing dormant-world state.
428-437: Movement ETA handling is now hardened.Tech-Priest, Line 431 and Line 434 clamp ETA safely, and Line 437 includes the boundary case, preventing stalled transit states.
scripts/scr_logging_functions/scr_logging_functions.gml (1)
47-61: Context extraction rite is clean and decoupled.Tech-Priest, Line 47 to Line 61 cleanly isolates game-state context for downstream error handling.
objects/obj_turn_end/Alarm_0.gml (1)
1-1: Top-level fault handling migration is coherent.Tech-Priest, Line 1 and Line 217 to Line 219 centralise exception routing without perturbing the battle queue rites.
Also applies to: 217-219
objects/obj_en_fleet/Alarm_4.gml (1)
1-3: Exception scaffold alignment is sound.Tech-Priest, the Line 1 to Line 122 refit keeps fleet movement semantics intact while standardising failure handling.
Also applies to: 39-39, 120-122
objects/obj_p_fleet/Alarm_1.gml (2)
22-23: Planetary traversal now reaches terminal indices.Tech-Priest, Line 22 and Line 123 now iterate inclusively through
planets, sealing the prior terminal-slot omission.Also applies to: 123-124
1-1: Top-level fault routing is now uniform.Tech-Priest, Line 1 and Line 174 to Line 176 align this alarm with the central
handle_exceptionpattern.Also applies to: 174-176
objects/obj_controller/Alarm_5.gml (1)
429-432: Faction disposition correction is now coherent.Tech-Priest, Line 431 now increments
eFACTION.INQUISITION, restoring symmetry with the surrounding disposition rites.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
objects/obj_controller/Alarm_5.gml (1)
23-33:⚠️ Potential issue | 🟠 MajorGuard
_starbefore all planet dereferences.Tech-Priest, Line 27 and Line 32 read
_star-bound fields before a reliable existence/planet-count gate. A no-star or zero-planet selection can rupture end-turn execution.🛠️ Proposed safeguard
- var xx3, yy3, plani, _star; + var xx3, yy3, plani, _star; xx3 = irandom(room_width) + 1; yy3 = irandom(room_height) + 1; _star = instance_nearest(xx3, yy3, obj_star); - plani = floor(random(_star.planets)) + 1; + plani = 0; // ** Chaos influence / corruption ** if ((faction_gender[eFACTION.CHAOS] == 1) && (faction_defeated[eFACTION.CHAOS] == 0) && (turn >= chaos_turn)) { repeat (times) { - if ((_star.p_type[plani] != "Dead") && (_star.planets > 0) && (turn >= 20)) { + if (instance_exists(_star) && (_star.planets > 0) && (turn >= 20)) { + plani = irandom_range(1, _star.planets); + if (_star.p_type[plani] == "Dead") { + continue; + } var cathedral = 0; if (planet_feature_bool(_star.p_feature[plani], eP_FEATURES.SORORITAS_CATHEDRAL) == 1) { cathedral = choose(0, 1, 1); }#!/bin/bash # Verify unsafe dereference ordering in the chaos block. rg -n -C3 '_star = instance_nearest|plani = floor\(random\(_star\.planets\)\)|_star\.p_type\[plani\]' objects/obj_controller/Alarm_5.gml
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
objects/obj_controller/Alarm_5.gmlscripts/scr_logging_functions/scr_logging_functions.gml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml
⚙️ CodeRabbit configuration file
- All code should comply with the 2026 GML documentation.
Files:
scripts/scr_logging_functions/scr_logging_functions.gmlobjects/obj_controller/Alarm_5.gml
**/*.*
⚙️ CodeRabbit configuration file
**/*.*: - Code Philosophy: Prioritize explicit intent and maintainability over brevity. If a
solution is "clever" but mentally taxing, request a refactor to a clearer approach.
Variable Naming: Use clear, descriptive names; avoid over-abbreviation.
Abstraction: Apply the "Rule of Three"; suggest abstraction only when similar logic is
repeated three or more times to avoid premature complexity.Subjective Choices: For naming or architecture, ask guiding questions to prompt developer
reflection and provide at least two alternative perspectives.TODOs: If a TODO comment is added, ask the user if a GitHub issue should be created. If a
TODO comment is deleted, remind the user to check the status of that specific issue.
Files:
scripts/scr_logging_functions/scr_logging_functions.gmlobjects/obj_controller/Alarm_5.gml
🧠 Learnings (7)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 424
File: scripts/scr_flavor/scr_flavor.gml:34-36
Timestamp: 2025-03-09T02:33:43.867Z
Learning: EttyKitty prefers to keep PRs focused on their stated goals and scope, and may decline to implement otherwise valid suggestions if they're not directly related to the PR's primary objective.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 579
File: objects/obj_enunit/Alarm_0.gml:200-202
Timestamp: 2025-03-11T01:38:19.874Z
Learning: EttyKitty welcomes easy, committable suggestions that improve documentation of code chunks, variables with strange names, and functions. Their codebase is generally lacking documentation, but they prioritize human-readable code above documentation.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: sprites/spr_weapon_phobos_bolt_pistol/spr_weapon_phobos_bolt_pistol.yy:26-44
Timestamp: 2025-06-16T17:08:08.239Z
Learning: EttyKitty prefers automated solutions over manual cleanup for .yy file formatting and is open to automated tools for GameMaker Studio .yy file cleanup.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 938
File: scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml:478-478
Timestamp: 2025-07-21T17:03:28.251Z
Learning: EttyKitty acknowledges when PRs contain scope creep and agrees that changes should be focused on the stated PR objectives, reinforcing their preference for keeping PRs narrowly scoped to their primary purpose.
📚 Learning: 2025-09-04T14:52:45.005Z
Learnt from: OH296
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-09-04T14:52:45.005Z
Learning: Project coding style summary:
- Constructors PascalCase; functions/variables snake_case with group prefixes (scr_*).
- Enums: enum name eNAME in SNAKE_CASE; entries PascalCase.
- Macros: ALL_CAPS SNAKE_CASE.
- Indentation 4 spaces; semicolons; use &&/||; parentheses for mixed ops; prefer ++/--.
- Prefer template strings $"..."; use “///” doc comments.
- Locals recommended with leading underscore.
- Organize scripts into library-like files; use early returns and init vars at declaration.
Applied to files:
scripts/scr_logging_functions/scr_logging_functions.gml
📚 Learning: 2025-03-01T11:06:25.427Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.
Applied to files:
objects/obj_controller/Alarm_5.gml
📚 Learning: 2026-01-28T13:37:09.640Z
Learnt from: OH296
Repo: Adeptus-Dominus/ChapterMaster PR: 646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2026-01-28T13:37:09.640Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.
Applied to files:
objects/obj_controller/Alarm_5.gml
📚 Learning: 2025-02-18T17:36:23.214Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-02-18T17:36:23.214Z
Learning: When commenting out code, add TODO comments explaining why the code is commented out.
Applied to files:
objects/obj_controller/Alarm_5.gml
📚 Learning: 2025-03-06T16:02:06.286Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 554
File: objects/obj_popup/Step_0.gml:756-767
Timestamp: 2025-03-06T16:02:06.286Z
Learning: The variable 'woopwoopwoop' in the ChapterMaster codebase is a poorly named multi-purpose variable used both for controlling ancient ruins combat flow and for passing menu state in the save/load system. This type of naming makes code maintenance difficult.
Applied to files:
objects/obj_controller/Alarm_5.gml
📚 Learning: 2025-03-07T01:56:40.971Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 562
File: scripts/scr_marine_struct/scr_marine_struct.gml:0-0
Timestamp: 2025-03-07T01:56:40.971Z
Learning: Marines' ages should be incremented at the year transition in obj_turn_end/Alarm_1.gml rather than calculated dynamically based on the current year and recruitment date. This ensures proper aging without retroactive application.
Applied to files:
objects/obj_controller/Alarm_5.gml
🔇 Additional comments (3)
objects/obj_controller/Alarm_5.gml (2)
358-369: Guarded warlord placement is sound.Tech-Priest, the
_candidate_planetslength check now shields all downstream writes from empty-pool faults. This correction is worthy.
431-432: Disposition target correction accepted.Tech-Priest, shifting the increment to
eFACTION.INQUISITIONresolves the faction accounting drift in Penitent Crusade resolution.scripts/scr_logging_functions/scr_logging_functions.gml (1)
187-191: Stacktrace sanitisation centralisation is clean.Tech-Priest, routing all lines through
clean_stacktrace_linein one helper reduces divergence across exception paths. This is a worthy refactor.
No description provided.