Raycast API changes.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user