예제 #1
0
        public bool SetTrainEntityStanding_NoSync(CustomEntity ent, Player owner)
        {
            var mymod      = OnARailMod.Instance;
            var encumb_mod = ModLoader.GetMod("Encumbrance");

            this.IsMountedBy = -1;

            owner.position.Y -= 12;

            ent.Core.Center      = owner.Center;
            ent.Core.position.Y -= 16;
            ent.Core.direction   = owner.direction;

            if (encumb_mod != null)
            {
                encumb_mod.Call("EnableEncumbrance");
            }

            if (owner.whoAmI == Main.myPlayer && Main.netMode == 1)                  // needed because player mounts aren't synced to server...?
            {
                ent.SyncToAll();
            }

            return(true);
        }
예제 #2
0
        ////

        protected virtual bool UpdateMe(CustomEntity ent)
        {
            if (this.NextSync-- <= 0)
            {
                this.NextSync = PeriodicSyncEntityComponent.GetRandomSyncDuration();

                ent.SyncToAll();
                return(true);
            }
            return(false);
        }