new layers (#483)

This commit is contained in:
L.E.D
2019-12-01 09:20:50 -05:00
committed by Pieter-Jan Briers
parent 7c54a3c923
commit fac91af34d
31 changed files with 56 additions and 3915 deletions

View File

@@ -111,7 +111,7 @@ namespace Content.Server.AI
// build the ray
var dir = entity.GetComponent<ITransformComponent>().WorldPosition - myTransform.WorldPosition;
var ray = new Ray(myTransform.WorldPosition, dir.Normalized, (int)(CollisionGroup.Mob | CollisionGroup.Grid));
var ray = new Ray(myTransform.WorldPosition, dir.Normalized, (int)(CollisionGroup.MobImpassable | CollisionGroup.Impassable));
// cast the ray
var result = _physMan.IntersectRay(ray, maxRayLen);

View File

@@ -126,7 +126,7 @@ namespace Content.Server.AI
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 ray = new Ray(entWorldPos, dir, (int) CollisionGroup.Grid);
var ray = new Ray(entWorldPos, dir, (int) CollisionGroup.Impassable);
var rayResult = _physMan.IntersectRay(ray, MaxWalkDistance, SelfEntity);
if (rayResult.DidHitObject && rayResult.Distance > 1) // hit an impassable object