Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes obsolete code and adds comments in AIGroup::Group_Tighten_To_Position #937

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/game/logic/ai/aigroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1641,14 +1641,18 @@ void Get_Helicopter_Offset(Coord3D &pos, int count)
}
}

/**
Group_Tighten_To_Position - Performs tightening of the group members towards a target position.
This method iterates over the group members, calculates their distances to the target position,
and sorts them in ascending order based on the squared distance. It then applies tightening
behavior to each member based on the specified conditions.

@param target_pos The target position to tighten towards.
@param append A flag indicating whether to append to existing waypoints or not.
@param cmd_source The source of the command.
*/
void AIGroup::Group_Tighten_To_Position(const Coord3D *target_pos, bool append, CommandSourceType cmd_source)
{
if (cmd_source == COMMANDSOURCE_PLAYER && g_theWriteableGlobalData->m_groupMoveClickToGatherAreaFactor > 0.0f) {
Coord2D min;
Coord2D max;
Coord3D center;
Get_Min_Max_And_Center(&min, &max, &center);
}

MemoryPoolObjectHolder holder(nullptr);
SimpleObjectIterator *iter = new SimpleObjectIterator();
Expand Down