Resolve 'TransformComponent.MapPosition' is obsolete in content (#27939)
* Resolve `'TransformComponent.MapPosition' is obsolete: 'Use TransformSystem.GetMapCoordinates'` in content * build?
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Server.Forensics;
|
||||
using Content.Server.Stack;
|
||||
using Content.Shared.Prototypes;
|
||||
using Content.Shared.Stacks;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
|
||||
@@ -30,7 +31,8 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
|
||||
|
||||
public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
|
||||
{
|
||||
var position = system.EntityManager.GetComponent<TransformComponent>(owner).MapPosition;
|
||||
var tSys = system.EntityManager.System<TransformSystem>();
|
||||
var position = tSys.GetMapCoordinates(owner);
|
||||
|
||||
var getRandomVector = () => new Vector2(system.Random.NextFloat(-Offset, Offset), system.Random.NextFloat(-Offset, Offset));
|
||||
|
||||
@@ -48,7 +50,8 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
|
||||
? minMax.Min
|
||||
: system.Random.Next(minMax.Min, minMax.Max + 1);
|
||||
|
||||
if (count == 0) continue;
|
||||
if (count == 0)
|
||||
continue;
|
||||
|
||||
if (EntityPrototypeHelpers.HasComponent<StackComponent>(entityId, system.PrototypeManager, system.ComponentFactory))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user