Skip to content

update opParam of MSG_SELECT_SUM#2491

Merged
mercury233 merged 5 commits into
Fluorohydride:masterfrom
mercury233:patch-sum-param
Jun 29, 2025
Merged

update opParam of MSG_SELECT_SUM#2491
mercury233 merged 5 commits into
Fluorohydride:masterfrom
mercury233:patch-sum-param

Conversation

@mercury233

Copy link
Copy Markdown
Collaborator

@mercury233 mercury233 added this to the Version 0x1362 milestone May 17, 2025
@purerosefallen

This comment was marked as off-topic.

@mercury233

Copy link
Copy Markdown
Collaborator Author

Please open a PR to each of the following repos about this change.

  • SRVPro (struct.json)
  • WindBot
  • YGOPro2

You don't maintain WindBot nor YGOPro2, so please don't ask anybody to do that.

@purerosefallen

Copy link
Copy Markdown
Collaborator

Please open a PR to each of the following repos about this change.

  • SRVPro (struct.json)
  • WindBot
  • YGOPro2

You don't maintain WindBot nor YGOPro2, so please don't ask anybody to do that.

It's you who opened this PR, so you are expected to maintain the whole related ecosystem.

@mercury233

Copy link
Copy Markdown
Collaborator Author

Please open a PR to each of the following repos about this change.

  • SRVPro (struct.json)
  • WindBot
  • YGOPro2

You don't maintain WindBot nor YGOPro2, so please don't ask anybody to do that.

It's you who opened this PR, so you are expected to maintain the whole related ecosystem.

Nobody is. Who merge this PR may consider about that but them aren't required to do that.

@mercury233 mercury233 requested a review from Copilot June 19, 2025 05:37

This comment was marked as outdated.

@mercury233 mercury233 marked this pull request as ready for review June 19, 2025 06:30
@mercury233 mercury233 requested a review from Copilot June 29, 2025 02:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

The PR introduces a helper to centralize parsing of opParam into two operands and updates multiple sum‐selection methods to use this helper.

  • Added get_sum_params to ClientField for consistent bit‐field extraction, including special handling when the high bit flags a single parameter.
  • Replaced repeated manual masking/shifting of opParam in various sum and tribute checks with calls to get_sum_params.
  • Updated client_field.cpp to implement the new helper and cleaned up duplicated logic.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
gframe/client_field.h Declared get_sum_params to centralize opParam parsing
gframe/client_field.cpp Implemented get_sum_params and refactored repeated bit logic
Comments suppressed due to low confidence (3)

gframe/client_field.h:122

  • [nitpick] The method name get_sum_params uses snake_case while other ClientField methods use PascalCase (e.g., CheckSelectSum). Consider renaming to GetSumParams to match the existing naming convention.
	void get_sum_params(unsigned int opParam, int& op1, int& op2);

gframe/client_field.cpp:1294

  • Add a comment or docstring explaining the purpose of get_sum_params, especially the special-case logic when the high bit indicates a single-parameter encoding.
void ClientField::get_sum_params(unsigned int opParam, int& op1, int& op2) {

gframe/client_field.h:122

  • No tests cover the new get_sum_params logic. Consider adding unit tests for typical cases and edge cases (e.g., when the high bit is set) to ensure correctness.
	void get_sum_params(unsigned int opParam, int& op1, int& op2);

Comment thread gframe/client_field.cpp
Comment thread gframe/client_field.h
@@ -119,6 +119,7 @@ class ClientField: public irr::IEventReceiver {
bool ShowSelectSum(bool panelmode);
bool CheckSelectSum();
bool CheckSelectTribute();

Copilot AI Jun 29, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] get_sum_params appears to be an internal helper; consider making it private (or static) to limit its visibility and clarify its usage scope.

Suggested change
bool CheckSelectTribute();
bool CheckSelectTribute();
private:

Copilot uses AI. Check for mistakes.
@mercury233 mercury233 merged commit db1633b into Fluorohydride:master Jun 29, 2025
8 checks passed
@mercury233 mercury233 deleted the patch-sum-param branch June 29, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants