Fix body component not setting client movement speed on initialize
This commit is contained in:
@@ -58,10 +58,9 @@ namespace Content.Shared.GameObjects.Components.Body
|
|||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public IReadOnlyDictionary<string, IBodyPart> Parts => _parts;
|
public IReadOnlyDictionary<string, IBodyPart> Parts => _parts;
|
||||||
|
|
||||||
|
[ViewVariables]
|
||||||
public IReadOnlyDictionary<string, string> PartIds => _partIds;
|
public IReadOnlyDictionary<string, string> PartIds => _partIds;
|
||||||
|
|
||||||
[ViewVariables] public IReadOnlyDictionary<string, string> PartIDs => _partIds;
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -116,6 +115,7 @@ namespace Content.Shared.GameObjects.Components.Body
|
|||||||
}
|
}
|
||||||
|
|
||||||
Connections = cleanedConnections;
|
Connections = cleanedConnections;
|
||||||
|
CalculateSpeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool CanAddPart(string slot, IBodyPart part)
|
protected virtual bool CanAddPart(string slot, IBodyPart part)
|
||||||
@@ -473,7 +473,7 @@ namespace Content.Shared.GameObjects.Components.Body
|
|||||||
var legs = GetPartsWithProperty<LegComponent>();
|
var legs = GetPartsWithProperty<LegComponent>();
|
||||||
float speedSum = 0;
|
float speedSum = 0;
|
||||||
|
|
||||||
foreach (var leg in GetPartsWithProperty<LegComponent>())
|
foreach (var leg in legs)
|
||||||
{
|
{
|
||||||
var footDistance = DistanceToNearestFoot(leg.part);
|
var footDistance = DistanceToNearestFoot(leg.part);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user