Skip to content

fix: Disappearing player fleets after clearing ruins#969

Merged
OH296 merged 2 commits intoAdeptus-Dominus:mainfrom
OH296:disapearing_fleets
Aug 14, 2025
Merged

fix: Disappearing player fleets after clearing ruins#969
OH296 merged 2 commits intoAdeptus-Dominus:mainfrom
OH296:disapearing_fleets

Conversation

@OH296
Copy link
Copy Markdown
Collaborator

@OH296 OH296 commented Aug 14, 2025

Purpose and Description

  • makes sure player fleets don't get deactivated when clearing ruins
  • add two functions to help
    • scr_orbiting_player_fleet to get a systems orbiting fleet
    • object_distance to simplifying getting the distance between two objects

Testing done

diid a few ruins

Related things and/or additional context

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 14, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • The game can now identify the player fleet currently orbiting a star, enabling more accurate context-aware interactions.
  • Bug Fixes

    • Orbit detection is more reliable, with clearer handling when no fleet is orbiting.
    • Ruins rewards now only select a ship when a valid orbiting player fleet is present, preventing incorrect or unintended selections.

Walkthrough

By the Omnissiah, changes logged: fleet orbit detection refactored to accept an optional fleet parameter, new distance helper added, and a public function introduced to resolve the player’s orbiting fleet. Ruins reward logic now conditionally selects a ship only when an orbiting player fleet function is available.

Changes

Cohort / File(s) Summary
Fleet orbit utilities
scripts/scr_fleet_functions/scr_fleet_functions.gml
Updated is_orbiting(fleet = "none") to delegate when fleet provided; preserved legacy path otherwise with explicit false when not orbiting. Added object_distance(obj_1, obj_2). Added scr_orbiting_player_fleet(system = "none") to resolve the player’s orbiting fleet id or -1.
Ruins reward ship selection
scripts/scr_ruins_reward/scr_ruins_reward.gml
Replaced unconditional player-fleet handling with guarded logic: if scr_orbiting_player_fleet exists, derive ships from nearest fleet and choose first; otherwise leave _chosen_ship at -1.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

PR: Fix, Size: Tiny

Suggested reviewers

  • EttyKitty

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: Small Type: Fix This is a fix for a bug labels Aug 14, 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: 4

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4b24c3d and 6d9ccca.

📒 Files selected for processing (2)
  • scripts/scr_fleet_functions/scr_fleet_functions.gml (2 hunks)
  • scripts/scr_ruins_reward/scr_ruins_reward.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_ruins_reward/scr_ruins_reward.gml
  • scripts/scr_fleet_functions/scr_fleet_functions.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
  • scripts/scr_fleet_functions/scr_fleet_functions.gml

@OH296 OH296 merged commit 46722b6 into Adeptus-Dominus:main Aug 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant