mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
28 lines
754 B
C#
28 lines
754 B
C#
using OWML.Common;
|
|
using QSB.Messaging;
|
|
using QSB.MeteorSync.WorldObjects;
|
|
using QSB.Utility;
|
|
|
|
namespace QSB.MeteorSync.Messages;
|
|
|
|
/// <summary>
|
|
/// original integrity, leash length
|
|
/// </summary>
|
|
public class FragmentInitialStateMessage : QSBWorldObjectMessage<QSBFragment, (float OrigIntegrity, float LeashLength)>
|
|
{
|
|
public FragmentInitialStateMessage(float origIntegrity, float leashLength) : base((origIntegrity, leashLength)) { }
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
WorldObject.AttachedObject._origIntegrity = Data.OrigIntegrity;
|
|
if (WorldObject.LeashLength == null)
|
|
{
|
|
WorldObject.LeashLength = Data.LeashLength;
|
|
}
|
|
else
|
|
{
|
|
DebugLog.ToConsole($"leash length for {WorldObject} already set", MessageType.Warning);
|
|
}
|
|
}
|
|
}
|