Normalize wander AI's direction vector (#549)
This commit is contained in:
parent
09a27df6db
commit
664acb140e
1 changed files with 1 additions and 1 deletions
|
|
@ -125,7 +125,7 @@ namespace Content.Server.AI
|
|||
var rngState = GenSeed();
|
||||
for (var i = 0; i < 3; i++) // you get 3 chances to find a place to walk
|
||||
{
|
||||
var dir = new Vector2(Random01(ref rngState) * 2 - 1, Random01(ref rngState) *2 -1);
|
||||
var dir = new Vector2(Random01(ref rngState) * 2 - 1, Random01(ref rngState) *2 -1).Normalized;
|
||||
var ray = new Ray(entWorldPos, dir, (int) CollisionGroup.Impassable);
|
||||
var rayResult = _physMan.IntersectRay(ray, MaxWalkDistance, SelfEntity);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue