mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
Replace obsolete functions in NPC systems (#31448)
(cherry picked from commit e85c25a7468b4daea7a5f1deb85900a9151651cf) Signed-off-by: Spatison <137375981+Spatison@users.noreply.github.com>
This commit is contained in:
@@ -22,7 +22,7 @@ public sealed partial class NPCSteeringSystem
|
||||
if (weight == 0f || direction == Vector2.Zero)
|
||||
return;
|
||||
|
||||
var directionAngle = (float) direction.ToAngle().Theta;
|
||||
var directionAngle = (float)direction.ToAngle().Theta;
|
||||
|
||||
for (var i = 0; i < InterestDirections; i++)
|
||||
{
|
||||
@@ -166,8 +166,8 @@ public sealed partial class NPCSteeringSystem
|
||||
}
|
||||
|
||||
// Check if mapids match.
|
||||
var targetMap = targetCoordinates.ToMap(EntityManager, _transform);
|
||||
var ourMap = ourCoordinates.ToMap(EntityManager, _transform);
|
||||
var targetMap = _transform.ToMapCoordinates(targetCoordinates);
|
||||
var ourMap = _transform.ToMapCoordinates(ourCoordinates);
|
||||
|
||||
if (targetMap.MapId != ourMap.MapId)
|
||||
{
|
||||
@@ -429,7 +429,7 @@ public sealed partial class NPCSteeringSystem
|
||||
|
||||
if (TryComp<PhysicsComponent>(uid, out var physics))
|
||||
{
|
||||
mask = (CollisionGroup) physics.CollisionMask;
|
||||
mask = (CollisionGroup)physics.CollisionMask;
|
||||
}
|
||||
|
||||
for (var i = 0; i < nodes.Count; i++)
|
||||
@@ -439,7 +439,7 @@ public sealed partial class NPCSteeringSystem
|
||||
if (!node.Data.IsFreeSpace)
|
||||
break;
|
||||
|
||||
var nodeMap = node.Coordinates.ToMap(EntityManager, _transform);
|
||||
var nodeMap = _transform.ToMapCoordinates(node.Coordinates);
|
||||
|
||||
// If any nodes are 'behind us' relative to the target we'll prune them.
|
||||
// This isn't perfect but should fix most cases of stutter stepping.
|
||||
|
||||
Reference in New Issue
Block a user