8000 refactor(pathfinder): Remove unused function Pathfinder::pathDestination() by Caball009 · Pull Request #2308 · TheSuperHackers/GeneralsGameCode · GitHub
[go: up one dir, main page]

Skip to content

refactor(pathfinder): Remove unused function Pathfinder::pathDestination()#2308

Merged
xezon merged 2 commits intoTheSuperHackers:mainfrom
Caball009:remove_Pathfinder_pathDestination
Feb 21, 2026
Merged

refactor(pathfinder): Remove unused function Pathfinder::pathDestination()#2308
xezon merged 2 commits intoTheSuperHackers:mainfrom
Caball009:remove_Pathfinder_pathDestination

Conversation

@Caball009
Copy link

Function Pathfinder::pathDestination isn't used now nor in the first usable branch, so this PR removes it.

Fortunately, it wasn't used because there would likely be a bug due to the uninitialized coordinate variable here, same as Pathfinder::tightenPathCallback:

@Caball009 Caball009 added Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Refactor Edits the code with insignificant behavior changes, is never user facing labels Feb 15, 2026
@greptile-apps
Copy link
greptile-apps bot commented Feb 15, 2026

Greptile Summary

Removed the unused Pathfinder::pathDestination function from both Generals and GeneralsMD codebases.

  • Removed function declaration from both header files
  • Removed 260-line function implementation from both source files
  • No references to this function exist anywhere in the codebase
  • Function contained a potential bug with uninitialized variable pos passed to checkForAdjust, which reads the coordinate before writing to it

Confidence Score: 5/5

  • This PR is safe to merge - it only removes dead code
  • The function is completely unused throughout the codebase and the removal is clean with no impact on existing functionality
  • No files require special attention

Important Files Changed

Filename Overview
Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h Removed unused pathDestination function declaration
Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp Removed unused pathDestination function implementation (260 lines)
GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h Removed unused pathDestination function declaration
GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp Removed unused pathDestination function implementation (260 lines)

Last reviewed commit: fa86715

@xezon xezon requested a review from Mauller February 15, 2026 09:30
@Mauller
Copy link
Mauller commented Feb 15, 2026

I will double check this again, the code appears unused, i believe it was an earlier implementation of what ended up split out into multiple functions.

@Caball009
Copy link
Author

@Mauller

Copy link
@Skyaero42 Skyaero42 left a comment

Choose a reason for hiding this comment

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

It is not used this PR saves a lot of code maintenanced with upcoming path changes.

Copy link
@Mauller Mauller left a comment

Choose a reason for hiding this comment

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

Yes this is fine to remove, but hold off till #2327 is merged first then rebase this one.

@Caball009 Caball009 force-pushed the remove_Pathfinder_pathDestination branch from 50dc090 to 2837a7d Compare February 21, 2026 20:35
@Caball009 Caball009 force-pushed the remove_Pathfinder_pathDestination branch from 2837a7d to fa86715 Compare February 21, 2026 20:48
@xezon xezon changed the title refactor(pathfinder): Remove unused function pathDestination refactor(pathfinder): Remove unused function Pathfinder::pathDestination() Feb 21, 2026
@xezon xezon merged commit 7b3f70a into TheSuperHackers:main Feb 21, 2026
25 checks passed
@Caball009 Caball009 deleted the remove_Pathfinder_pathDestination branch February 21, 2026 21:21
CookieLandProjects pushed a commit to CookieLandProjects/CLP_AI that referenced this pull request Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0