Core/AreaTriggers: Fixed selection range of units for box shape
Co-authored-by: Meji <[email protected]>
This commit is contained in:
@@ -456,7 +456,7 @@ void AreaTrigger::SearchUnitInBox(std::vector<Unit*>& targetList)
|
||||
|
||||
targetList.erase(std::remove_if(targetList.begin(), targetList.end(), [boxCenter, extentsX, extentsY, extentsZ](Unit* unit) -> bool
|
||||
{
|
||||
return !unit->IsWithinBox(boxCenter, extentsX, extentsY, extentsZ);
|
||||
return !unit->IsWithinBox(boxCenter, extentsX, extentsY, extentsZ/2);
|
||||
}), targetList.end());
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ float AreaTriggerShapeInfo::GetMaxSearchRadius() const
|
||||
case AREATRIGGER_TYPE_SPHERE:
|
||||
return std::max(SphereDatas.Radius, SphereDatas.RadiusTarget);
|
||||
case AREATRIGGER_TYPE_BOX:
|
||||
return std::sqrt(BoxDatas.Extents[0] * BoxDatas.Extents[0] / 4 + BoxDatas.Extents[1] * BoxDatas.Extents[1] / 4);
|
||||
return std::sqrt(BoxDatas.Extents[0] * BoxDatas.Extents[0] + BoxDatas.Extents[1] * BoxDatas.Extents[1]);
|
||||
case AREATRIGGER_TYPE_CYLINDER:
|
||||
return std::max(CylinderDatas.Radius, CylinderDatas.RadiusTarget);
|
||||
case AREATRIGGER_TYPE_DISK:
|
||||
|
||||
Reference in New Issue
Block a user