Skip to content

fix: Condemnor bolter#489

Merged
OH296 merged 4 commits intoAdeptus-Dominus:mainfrom
Blogaugis:condemnor-fix
Feb 18, 2025
Merged

fix: Condemnor bolter#489
OH296 merged 4 commits intoAdeptus-Dominus:mainfrom
Blogaugis:condemnor-fix

Conversation

@Blogaugis
Copy link
Copy Markdown
Collaborator

@Blogaugis Blogaugis commented Feb 17, 2025

Description of changes

  • Comments out condemnor bolter in the inquisition faction's trade screen.

Reasons for changes

  • Players attempting to buy condemnor bolters experience crashes to desktop, as this bolter does not exist elsewhere. This fixes it.

Related links

How have you tested your changes?

  • Compile
  • New game
  • Next turn
  • Space Travel
  • Ground Battle

- Comments out condemnor bolters on the inquisition trade screen.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 17, 2025

Warning

Rate limit exceeded

@EttyKitty has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 558e6b8 and 1eccc96.

📒 Files selected for processing (1)
  • scripts/scr_trade_add/scr_trade_add.gml (1 hunks)
📝 Walkthrough

Walkthrough

The changes update the trading and mouse interaction logic within the game's menu system. Adjustments were made to the way trade goods are handled, particularly concerning the Inquisition trade items. Specific items, including the "Condemnor Boltgun," have been commented out, indicating they are temporarily disabled due to related crashes. The calculation for trade worth was altered, with lines involving the "Condemnor Boltgun" commented out in both the trade calculation and trade addition functions, preventing specific bonuses or user prompts associated with that item from being executed. Additionally, the previously included fleet count logic has been entirely commented out. The overall structure of the mouse interactions and trade calculations remains intact, with only specific parts being disabled or updated. No changes were made to the exported or public entities.

Possibly related PRs

  • fix: Trait cost adjustments #490: The changes in the main PR regarding the "Condemnor Boltgun" trade item being commented out are directly related to the modifications in the retrieved PR, which also involves commenting out logic associated with the same item in the trading functions.
  • fix: small bug fixes and fix research tree #492: The changes in the main PR, specifically the commenting out of the "Condemnor Boltgun" in the trading logic, are directly related to the modifications in the retrieved PR where the same item is also commented out in the scr_trade function, indicating a shared focus on the handling of this specific trade item.

Suggested reviewers

  • OH296

🪧 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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 the Type: Fix This is a fix for a bug label Feb 17, 2025
@EttyKitty
Copy link
Copy Markdown
Collaborator

@coderabbitai can you add todo comments to commented out code parts?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 18, 2025

🧩 Analysis chain

@EttyKitty I'll help you add a TODO comment to the commented code. Here's how it should look:

// TODO: Condemnor bolter is commented out as it causes crashes when players attempt to buy it.
// This weapon doesn't exist elsewhere in the game. Re-enable once the weapon is properly implemented.
//if (inquisition_trade_screen == 2)
//{
//    draw_text_transformed(argument0 + 32, argument1 + 32, "Condemnor Bolter", 0.7, 0.7, 0);
//    draw_text_transformed(argument0 + 32, argument1 + 48, "Cost: 35", 0.6, 0.6, 0);
//}

This TODO comment clearly explains:

  1. What is commented out
  2. Why it was commented out
  3. What needs to be done to re-enable it

Would you like me to trigger a review to implement this change?


🏁 Script executed:

#!/bin/bash
# Search for files containing condemnor bolter
rg -i "condemnor.?bolter" -A 5 -B 5

Length of output: 37


🏁 Script executed:

#!/bin/bash
# Get the PR diff
gh pr diff 489

Length of output: 3282


@EttyKitty I found three files where Condemnor Bolter related code is commented out. Here are the suggested TODO comments for each location:

  1. In objects/obj_controller/Mouse_50.gml:
// TODO: Condemnor Boltgun is temporarily disabled as it causes crashes when players attempt to buy it.
// Re-enable once the weapon is properly implemented in the game.
// trade_theirs[1]="Condemnor Boltgun";
// trade_disp[1]=20;
  1. In scripts/scr_trade/scr_trade.gml:
// TODO: Condemnor Boltgun worth calculation disabled due to weapon being temporarily removed.
// Re-enable when the weapon is properly implemented.
// if (trade_take[i]="Condemnor Boltgun") then their_worth+=trade_tnum[i]*15;
  1. In scripts/scr_trade_add/scr_trade_add.gml:
// TODO: Condemnor Boltgun trade dialog disabled due to weapon being temporarily removed.
// Re-enable when the weapon is properly implemented.
// if (argument0="Condemnor Boltgun"){get_diag_integer("Condemnor Boltguns wanted?",20,"t"+string(thinz),"Condemnor Boltgun");}

Would you like me to trigger a review to implement these changes?


✏️ Learnings added
Learnt from: EttyKitty
URL: https://github.com/Adeptus-Dominus/ChapterMaster/pull/489

Timestamp: 2025-02-18T17:36:22.945Z
Learning: When commenting out code, add TODO comments explaining why the code is commented out and what conditions need to be met to re-enable it.

Learnt from: EttyKitty
URL: https://github.com/Adeptus-Dominus/ChapterMaster/pull/489

Timestamp: 2025-02-18T17:36:22.945Z
Learning: When commenting out related code across multiple files, add consistent TODO comments in all locations to maintain traceability and explain the reason for commenting out the code.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7038ad4 and 2ba5170.

📒 Files selected for processing (3)
  • objects/obj_controller/Mouse_50.gml (1 hunks)
  • scripts/scr_trade/scr_trade.gml (1 hunks)
  • scripts/scr_trade_add/scr_trade_add.gml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • scripts/scr_trade_add/scr_trade_add.gml

@EttyKitty
Copy link
Copy Markdown
Collaborator

@coderabbitai yes, please do that.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 18, 2025

@EttyKitty I'll trigger a review to implement the TODO comments as discussed.

(`・ω・´)ゞ

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

EttyKitty and others added 2 commits February 18, 2025 22:25
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@EttyKitty
Copy link
Copy Markdown
Collaborator

@coderabbitai you forgot to add a comment into the scr_trade_add.gml.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 18, 2025

🧩 Analysis chain

@EttyKitty You're right, I apologize for the oversight. I'll trigger a review to add the missing TODO comment in scr_trade_add.gml:

// TODO: Condemnor Boltgun trade dialog disabled due to weapon being temporarily removed.
// Re-enable when the weapon is properly implemented.
// if (argument0="Condemnor Boltgun"){get_diag_integer("Condemnor Boltguns wanted?",20,"t"+string(thinz),"Condemnor Boltgun");}

🏁 Script executed:

#!/bin/bash
# Search for TODO comments in scr_trade_add.gml
rg -i "TODO" "scripts/scr_trade_add/scr_trade_add.gml"

Length of output: 52


🏁 Script executed:

#!/bin/bash
# Search for Condemnor in the trade_add script with context
rg -i "condemnor" "scripts/scr_trade_add/scr_trade_add.gml" -B 2 -A 2

Length of output: 429


🏁 Script executed:

#!/bin/bash
# First, find the exact file path
fd -t f "scr_trade_add.gml"
# Then, show its content
fd -t f "scr_trade_add.gml" -x cat {}

Length of output: 3684


@EttyKitty Looking at the file content, I can confirm that the TODO comment is indeed missing. I'll trigger another review to add the TODO comment above the commented-out code:

// TODO: Condemnor Boltgun trade dialog disabled due to weapon being temporarily removed.
// Re-enable when the weapon is properly implemented.
// if (argument0="Condemnor Boltgun"){get_diag_integer("Condemnor Boltguns wanted?",20,"t"+string(thinz),"Condemnor Boltgun");}
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@OH296 OH296 merged commit ebce670 into Adeptus-Dominus:main Feb 18, 2025
@Blogaugis Blogaugis deleted the condemnor-fix branch February 18, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Fix This is a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants