SyncBase: dont base.Update unless we also UpdateTransform

This commit is contained in:
JohnCorby 2022-01-16 02:36:39 -08:00
parent c4b771589b
commit a5a3688a47

View File

@ -129,21 +129,17 @@ namespace QSB.Syncs
catch (Exception ex) catch (Exception ex)
{ {
DebugLog.ToConsole($"Exception when initializing {name} : {ex}", MessageType.Error); DebugLog.ToConsole($"Exception when initializing {name} : {ex}", MessageType.Error);
return;
} }
base.Update();
return;
} }
else if (_isInitialized && (!IsReady || !_baseIsReady)) else if (_isInitialized && (!IsReady || !_baseIsReady))
{ {
_isInitialized = false; _isInitialized = false;
base.Update();
return; return;
} }
if (!_isInitialized) if (!_isInitialized)
{ {
base.Update();
return; return;
} }
@ -151,33 +147,27 @@ namespace QSB.Syncs
{ {
DebugLog.ToConsole($"Warning - AttachedObject {LogName} is null.", MessageType.Warning); DebugLog.ToConsole($"Warning - AttachedObject {LogName} is null.", MessageType.Warning);
_isInitialized = false; _isInitialized = false;
base.Update();
return; return;
} }
if (!AttachedTransform.gameObject.activeInHierarchy && !IgnoreDisabledAttachedObject) if (!AttachedTransform.gameObject.activeInHierarchy && !IgnoreDisabledAttachedObject)
{ {
base.Update();
return; return;
} }
else
if (ReferenceTransform != null && ReferenceTransform.position == Vector3.zero && ReferenceTransform != Locator.GetRootTransform())
{ {
if (ReferenceTransform != null && ReferenceTransform.position == Vector3.zero && ReferenceTransform != Locator.GetRootTransform()) DebugLog.ToConsole($"Warning - {LogName}'s ReferenceTransform is at (0,0,0). ReferenceTransform:{ReferenceTransform.name}, AttachedObject:{AttachedTransform.name}", MessageType.Warning);
{
DebugLog.ToConsole($"Warning - {LogName}'s ReferenceTransform is at (0,0,0). ReferenceTransform:{ReferenceTransform.name}, AttachedObject:{AttachedTransform.name}", MessageType.Warning);
}
} }
if (ReferenceTransform == Locator.GetRootTransform()) if (ReferenceTransform == Locator.GetRootTransform())
{ {
base.Update();
return; return;
} }
if (ReferenceTransform == null && !IgnoreNullReferenceTransform) if (ReferenceTransform == null && !IgnoreNullReferenceTransform)
{ {
DebugLog.ToConsole($"Warning - {LogName}'s ReferenceTransform is null. AttachedObject:{AttachedTransform.name}", MessageType.Warning); DebugLog.ToConsole($"Warning - {LogName}'s ReferenceTransform is null. AttachedObject:{AttachedTransform.name}", MessageType.Warning);
base.Update();
return; return;
} }
@ -188,7 +178,6 @@ namespace QSB.Syncs
} }
UpdateTransform(); UpdateTransform();
base.Update(); base.Update();
} }