Raycast API changes.

This commit is contained in:
Acruid
2020-01-25 12:15:04 -08:00
parent 5390a9f375
commit 59500e5278
4 changed files with 5 additions and 4 deletions

View File

@@ -114,7 +114,7 @@ namespace Content.Server.AI
var ray = new Ray(myTransform.WorldPosition, dir.Normalized, (int)(CollisionGroup.MobImpassable | CollisionGroup.Impassable));
// cast the ray
var result = _physMan.IntersectRay(ray, maxRayLen);
var result = _physMan.IntersectRay(myTransform.MapID, ray, maxRayLen, SelfEntity);
// add to visible list
if (result.HitEntity == entity)

View File

@@ -127,7 +127,7 @@ namespace Content.Server.AI
{
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);
var rayResult = _physMan.IntersectRay(SelfEntity.Transform.MapID, ray, MaxWalkDistance, SelfEntity);
if (rayResult.DidHitObject && rayResult.Distance > 1) // hit an impassable object
{