Lots of pathfinder bugfixes (#8248)
This commit is contained in:
@@ -263,7 +263,8 @@ namespace Content.Server.AI.Pathfinding
|
||||
|
||||
DebugTools.Assert((PathfindingSystem.TrackedCollisionLayers & physicsComponent.CollisionLayer) != 0);
|
||||
|
||||
if (physicsComponent.BodyType != BodyType.Static)
|
||||
if (physicsComponent.BodyType != BodyType.Static ||
|
||||
!physicsComponent.Hard)
|
||||
{
|
||||
_physicsLayers.TryAdd(entity, physicsComponent.CollisionLayer);
|
||||
}
|
||||
@@ -285,18 +286,19 @@ namespace Content.Server.AI.Pathfinding
|
||||
// There's no guarantee that the entity isn't deleted
|
||||
// 90% of updates are probably entities moving around
|
||||
// Entity can't be under multiple categories so just checking each once is fine.
|
||||
if (_physicsLayers.ContainsKey(entity))
|
||||
if (_physicsLayers.Remove(entity))
|
||||
{
|
||||
_physicsLayers.Remove(entity);
|
||||
return;
|
||||
}
|
||||
else if (_accessReaders.ContainsKey(entity))
|
||||
|
||||
if (_accessReaders.Remove(entity))
|
||||
{
|
||||
_accessReaders.Remove(entity);
|
||||
ParentChunk.Dirty();
|
||||
return;
|
||||
}
|
||||
else if (_blockedCollidables.ContainsKey(entity))
|
||||
|
||||
if (_blockedCollidables.Remove(entity))
|
||||
{
|
||||
_blockedCollidables.Remove(entity);
|
||||
GenerateMask();
|
||||
ParentChunk.Dirty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user