Restore original logic of CPed::WanderRange

This commit is contained in:
Sergeanur
2020-06-04 04:31:04 +03:00
parent 04de93796b
commit 12717917cc
4 changed files with 21 additions and 15 deletions

View File

@@ -18,5 +18,11 @@ CRange2D::DebugShowRange(float, int)
CVector2D
CRange2D::GetRandomPointInRange()
{
return CVector2D(CGeneral::GetRandomNumberInRange(min.x, max.x), CGeneral::GetRandomNumberInRange(min.y, max.y));
int distX = Abs(max.x - min.x);
int distY = Abs(max.y - min.y);
float outX = CGeneral::GetRandomNumber() % distX + min.x;
float outY = CGeneral::GetRandomNumber() % distY + min.y;
return CVector2D(outX, outY);
}