Skip to content

Commit

Permalink
changed TargetNearest to default to Living if no type was provided
Browse files Browse the repository at this point in the history
  • Loading branch information
DubbleClick committed Apr 25, 2024
1 parent b494d49 commit eb6fab2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GWToolboxdll/Modules/ChatCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ void CHAT_CMD_FUNC(ChatCommands::CmdTarget)
}
GW::Agents::ChangeTarget(agent);
}
return TargetNearest(GetRemainingArgsWstr(message, 1), Npc);
return TargetNearest(GetRemainingArgsWstr(message, 1), Living);
}

void CHAT_CMD_FUNC(ChatCommands::CmdUseSkill)
Expand Down Expand Up @@ -2742,10 +2742,10 @@ void ChatCommands::TargetNearest(const wchar_t* model_id_or_name, const TargetTy
}
if (index == 0) {
// target closest
const float newDistance = GetSquareDistance(me->pos, agent->pos);
if (newDistance < distance) {
const float new_distance = GetSquareDistance(me->pos, agent->pos);
if (new_distance < distance) {
closest = agent->agent_id;
distance = newDistance;
distance = new_distance;
}
}
else {
Expand Down

0 comments on commit eb6fab2

Please sign in to comment.