Skip to content

Cleanup/refactor: Remove some redundant checks#3235

Merged
DevelopingTom merged 1 commit intomainfrom
remove-redundant-checks
Feb 18, 2026
Merged

Cleanup/refactor: Remove some redundant checks#3235
DevelopingTom merged 1 commit intomainfrom
remove-redundant-checks

Conversation

@VariableVince
Copy link
Contributor

@VariableVince VariableVince commented Feb 18, 2026

Description:

PR 3/x in effort to break up PR #3220. Follows on already merged #3233 and #3234. Precedes #3236.

Please see if these can be merged for v30.

  • ClientGameRunner: removed two redundant myPlayer===null checks since that was already done right above, instead use !.
  • BuildMenu: just like in UnitDisplay, assign public PlayerActions default value of null. So that in canCreateOrBuild, where we already do a === null check on it btw, we can safely skip the assignment to const buildableUnits and just directly loop over this.playerActions.buildableUnits.
  • RadialMenuElements: don't call canBuildOrUpgrade 3x in CreateMenuElements for the .map on flattenedBuildTable, instead do it once and re-use outcome.

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

Please put your Discord username so you can be contacted if a bug or regression is found:

tryout33

@VariableVince VariableVince added this to the v30 milestone Feb 18, 2026
@VariableVince VariableVince self-assigned this Feb 18, 2026
@VariableVince VariableVince requested a review from a team as a code owner February 18, 2026 20:57
@VariableVince VariableVince added the Refactor Code cleanup, technical debt, refactoring, and architecture improvements. label Feb 18, 2026
Copy link
Contributor

@DevelopingTom DevelopingTom left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-project-automation github-project-automation bot moved this from Triage to Final Review in OpenFront Release Management Feb 18, 2026
@DevelopingTom DevelopingTom added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit f1cd478 Feb 18, 2026
20 checks passed
@DevelopingTom DevelopingTom deleted the remove-redundant-checks branch February 18, 2026 21:12
@github-project-automation github-project-automation bot moved this from Final Review to Complete in OpenFront Release Management Feb 18, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 18, 2026
## Description:

PR 4/x in effort to break up PR
#3220. Follows on already
merged #3235.

Please see if these can be merged for v30.

- **Game**/**GameImpl**/**GameView**: nearbyUnits required "UnitType |
UnitType[]" for tiles, but calls UnitGrid nearbyUnits which requires
"UnitType | readonly UnitType[]". Made the requirement the same for
Game/GameImpl/GameView nearbyUnits. This way, we don't have make a
shallow copy of the StructureTypes array everytime we want to send it as
an argument. Other callers than listNukeBreakAlliance in Util.ts are
unaffected.
- **Util.ts**: listNukeBreakAlliance needs no shallow copy of
StructureTypes anymore as argument for NearbyUnits

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

tryout33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Code cleanup, technical debt, refactoring, and architecture improvements.

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants

Comments