Esempio n. 1
0
        private static void doUpdatePlayer(SFarmer farmer)
        {
            // Caused problems during weddings
            // (A week or so later) Might have been caused by something else - check if this is needed at some point
            if (Game1.eventUp && (farmer.currentLocation != Game1.currentLocation || Game1.currentLocation == null || Game1.currentLocation.currentEvent == null))
            {
                return;
            }

            int currAnimFrame = (int)Util.GetInstanceField(typeof(FarmerSprite), farmer.FarmerSprite, "currentAnimationFrames");

            if (farmer.CurrentTool != null &&
                farmer.FarmerSprite.indexInCurrentAnimation >= currAnimFrame - 1 - 1)
            {
                farmer.CurrentTool = null;
            }

            GameTime gt = new GameTime(new TimeSpan(), new TimeSpan(TimeSpan.TicksPerMillisecond * 16));

            farmer.FarmerSprite.setOwner(farmer); // Not sure why this is necessary
            farmer.UpdateIfOtherPlayer(gt);
        }