Skip to content

fix: Ruins reward compile error#973

Merged
OH296 merged 2 commits intoAdeptus-Dominus:mainfrom
OH296:ruins_Reward_compile
Aug 16, 2025
Merged

fix: Ruins reward compile error#973
OH296 merged 2 commits intoAdeptus-Dominus:mainfrom
OH296:ruins_Reward_compile

Conversation

@OH296
Copy link
Copy Markdown
Collaborator

@OH296 OH296 commented Aug 16, 2025

Purpose and Description

  • Self-descriptive.

Testing done

  • None, and I understand the risks.

Related things and/or additional context

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 16, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Ruins rewards now correctly recognise required items and artefacts, ensuring appropriate loot distribution.
    • Fleet selection around ruins is now scoped to the current star system, preventing cross-system mismatches.
    • Resolved a conditional handling issue that could occasionally block rewards from triggering, improving overall stability.

Walkthrough

By the Omnissiah’s will: The script scr_ruins_reward.gml now calls scr_orbiting_player_fleet with star_system. Conditional syntax corrected. Loot comparisons converted to equality operators. Reflects an API change: scr_orbiting_player_fleet(star_system).

Changes

Cohort / File(s) Summary of Changes
Ruins reward logic + API adaptation
scripts/scr_ruins_reward/scr_ruins_reward.gml
Updated call to scr_orbiting_player_fleet(star_system); fixed conditional brace; replaced assignment with equality in loot checks ("req", "artifact").

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

PR: Fix, Type: Fix, Size: Small

Suggested reviewers

  • EttyKitty

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Size: Tiny Type: Fix This is a fix for a bug labels Aug 16, 2025
Copy link
Copy Markdown
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

🔭 Outside diff range comments (5)
scripts/scr_ruins_reward/scr_ruins_reward.gml (5)

25-30: Exorcise assignment-in-conditional heresy (== vs =); prevents bad logic and compile woes

Several conditionals still use = instead of ==, causing state corruption and/or parser failure. Purge with the following:

-    if ((loot=="wild_card")){
-        if (ruins_type=1) then loot="gene_seed";// 
-        if (ruins_type=2) then loot="req";// 
-        if (ruins_type=6) then loot="gear";// 
+    if ((loot=="wild_card")){
+        if (ruins_type==1) then loot="gene_seed";// 
+        if (ruins_type==2) then loot="req";// 
+        if (ruins_type==6) then loot="gear";// 
         if (ruins_type>=10) then loot="req";// 
     }
...
-else if (loot="stc"){
+else if (loot=="stc"){
...
-else if (loot="gear"){
+else if (loot=="gear"){
...
-else if (ruins_type=3){
+else if (ruins_type==3){
...
-else if (ruins_type=4){
+else if (ruins_type==4){
...
-else if (ruins_type=5){
+else if (ruins_type==5){
...
-else if (ruins_type=6){
+else if (ruins_type==6){
...
-else if (loot="gene_seed"){// Requisition
+else if (loot=="gene_seed"){// Requisition
...
-else if (loot="bunker"){// Bunker
+else if (loot=="bunker"){// Bunker
...
-else if (loot="fortress"){// Fortress
+else if (loot=="fortress"){// Fortress
...
-else if (loot="starship"){// Starship
+else if (loot=="starship"){// Starship

Also applies to: 73-81, 101-101, 120-120, 139-139, 159-159, 194-194, 205-205, 215-215, 227-227


90-95: Remove trailing commas and fix statement terminators; compiler appeasement required

Trailing commas in choose() and an extra semicolon will halt compilation; a few lines also miss semicolons (consistency + style).

-    wen2=choose(1,2,);
+    wen2=choose(1,2);
...
-    wep4=choose("Assault Cannon","Plasma Cannon",);
+    wep4=choose("Assault Cannon","Plasma Cannon");
...
-    wep3=choose("Mars Plasma Cannon","Volkite Culverin",);
+    wep3=choose("Mars Plasma Cannon","Volkite Culverin");
-    wen5=choose(0,1)
+    wen5=choose(0,1);
-    wen5=choose(0,1)
+    wen5=choose(0,1);
-    wen5=choose(0,1)
+    wen5=choose(0,1);
-    var gene=floor(random_range(20,40))+1,pop=instance_create(0,0,obj_popup);;
+    var gene=floor(random_range(20,40))+1,pop=instance_create(0,0,obj_popup);

Also applies to: 125-126, 111-111, 130-130, 149-149, 206-206


179-187: Guard against empty items; avoid adding null relics

For cases where ruins_type falls outside handled ranges (e.g., 7–9), this avoids injecting empty items.

-    scr_add_item(wep1,wen1);
-    scr_add_item(wep2,wen2);
-    scr_add_item(wep3,wen3);
-    scr_add_item(wep4,wen4);
-    scr_add_item(wep5,wen5);
-    scr_add_item(wep6,wen6);
-    scr_add_item(wep7,wen7);
-    scr_add_item(wep8,wen8);
+    var _weps = [wep1, wep2, wep3, wep4, wep5, wep6, wep7, wep8];
+    var _wens = [wen1, wen2, wen3, wen4, wen5, wen6, wen7, wen8];
+    for (var i = 0; i < array_length(_weps); i++) {
+        if ((_wens[i] > 0) && (_weps[i] != "")) {
+            scr_add_item(_weps[i], _wens[i]);
+        }
+    }

223-223: Polish user-facing catechism (grammar tidy)

Minor text fixes for immersion and clarity.

-        pop.text="Praise the Emperor! We have found a massive, ancient fortress in needs of repairs. The gun batteries are rusted, and the walls are covered in moss with huge hole in it. Such a pity that such a majestic building is now a pale shadow of its former glory.  It is possible to repair the structure.  What is thy will?";
+        pop.text="Praise the Emperor! We have found a massive, ancient fortress in need of repairs. The gun batteries are rusted, and the walls are covered in moss with a huge hole in it. Such a pity that such a majestic building is now a pale shadow of its former glory. It is possible to repair the structure. What is thy will?";

34-40: Imperative: Align recursive API call by passing the system argument
The Machine-Spirit detects one remaining no-argument invocation of scr_orbiting_player_fleet within its own definition. To honour the updated signature, this recursive call must explicitly forward system.

• Update in scripts/scr_fleet_functions/scr_fleet_functions.gml around line 473:

 function scr_orbiting_player_fleet(system = "none"){
     …  
     } else{
         try{
-            with (system){
-                return scr_orbiting_player_fleet();
-            }
+            with (system){
+                return scr_orbiting_player_fleet(system);
+            }
         } catch(_exception){
             handle_exception(_exception);
         }

• After this change, re-run the sweep to confirm zero no-argument calls to scr_orbiting_player_fleet().

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between beaf8e9 and 817ebdc.

📒 Files selected for processing (1)
  • scripts/scr_ruins_reward/scr_ruins_reward.gml (3 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_ruins_reward/scr_ruins_reward.gml
**/*.*

⚙️ CodeRabbit Configuration File

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

Files:

  • scripts/scr_ruins_reward/scr_ruins_reward.gml
🔇 Additional comments (1)
scripts/scr_ruins_reward/scr_ruins_reward.gml (1)

45-55: Proper equality rites applied to loot checks

The switch to loot == "req"/"artifact" is correct and prevents accidental assignment in conditionals.

@OH296 OH296 merged commit d2de798 into Adeptus-Dominus:main Aug 16, 2025
3 checks passed
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.

1 participant