Exemplo n.º 1
0
        public bool Sync(WeaponComponent comp, CompBaseValues sync)
        {
            if (sync.Revision > Revision)
            {
                Revision = sync.Revision;
                Set.Sync(comp, sync.Set);
                State.Sync(comp, sync.State, CompStateValues.Caller.CompData);

                for (int i = 0; i < Targets.Length; i++)
                {
                    var w = comp.Platform.Weapons[i];
                    sync.Targets[i].SyncTarget(w, true);
                    Reloads[i].Sync(w, sync.Reloads[i], true);
                }

                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        public void Sync(WeaponComponent comp, CompBaseValues sync)
        {
            if (sync.Revision > Revision)
            {
                Revision = sync.Revision;
                Set.Sync(comp, sync.Set);
                State.Sync(comp, sync.State, CompStateValues.Caller.CompData);

                for (int i = 0; i < Targets.Length; i++)
                {
                    var w = comp.Platform.Weapons[i];
                    sync.Targets[i].SyncTarget(w);
                    Reloads[i].Sync(w, sync.Reloads[i]);
                }
            }
            else
            {
                Log.Line($"CompDynamicValues older revision");
            }
        }