2022-03-10 20:01:44 -08:00
|
|
|
|
using OWML.Common;
|
2021-12-22 22:59:08 -08:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.MeteorSync.WorldObjects;
|
|
|
|
|
using QSB.Utility;
|
2021-11-13 20:41:46 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.MeteorSync.Messages;
|
|
|
|
|
|
2022-03-10 20:20:37 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// original integrity, leash length
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class FragmentInitialStateMessage : QSBWorldObjectMessage<QSBFragment, (float OrigIntegrity, float LeashLength)>
|
2021-11-13 20:41:46 -08:00
|
|
|
|
{
|
2022-03-10 20:20:37 -08:00
|
|
|
|
public FragmentInitialStateMessage(float origIntegrity, float leashLength) : base((origIntegrity, leashLength)) { }
|
2021-12-22 22:59:08 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
2022-03-10 20:01:44 -08:00
|
|
|
|
WorldObject.AttachedObject._origIntegrity = Data.OrigIntegrity;
|
2022-03-10 20:20:37 -08:00
|
|
|
|
if (WorldObject.LeashLength == null)
|
|
|
|
|
{
|
|
|
|
|
WorldObject.LeashLength = Data.LeashLength;
|
|
|
|
|
}
|
|
|
|
|
else
|
2022-02-24 22:04:54 -08:00
|
|
|
|
{
|
2022-03-10 20:01:44 -08:00
|
|
|
|
DebugLog.ToConsole($"leash length for {WorldObject} already set", MessageType.Warning);
|
2022-03-02 19:46:33 -08:00
|
|
|
|
}
|
2021-11-13 20:41:46 -08:00
|
|
|
|
}
|
2022-03-10 20:01:44 -08:00
|
|
|
|
}
|