This commit is contained in:
sardelka9515
2022-10-23 19:02:39 +08:00
parent 6b34ab6e36
commit 2828b9b74f
114 changed files with 7374 additions and 7205 deletions

View File

@ -3,7 +3,7 @@
namespace RageCoop.Client
{
/// <summary>
/// Synchronized prop, mostly owned by server
/// Synchronized prop, mostly owned by server
/// </summary>
public class SyncedProp : SyncedEntity
{
@ -11,32 +11,35 @@ namespace RageCoop.Client
{
ID = id;
}
/// <summary>
/// The real entity
/// The real entity
/// </summary>
public Prop MainProp { get; set; }
internal new int OwnerID
{
get
{
// alwayse owned by server
return 0;
}
}
internal new int OwnerID =>
// alwayse owned by server
0;
internal override void Update()
{
if (!NeedUpdate) return;
if (!Model.IsLoaded)
{
Model.Request();
return;
}
if (!NeedUpdate) { return; }
if (!Model.IsLoaded) { Model.Request(); return; }
if (MainProp == null || !MainProp.Exists())
{
MainProp = World.CreateProp(Model, Position, Rotation, false, false);
MainProp.IsInvincible = true;
}
MainProp.Position = Position;
MainProp.Rotation = Rotation;
MainProp.SetFrozen(true);
LastUpdated = Main.Ticked;
}
}
}
}