Exemple #1
0
        /// <summary>
        /// Very basic Obstacle avoidance.
        ///
        /// Need to change this to a better waypoint system that uses our MapNode Database...
        /// </summary>
        /// <param name="initialPosition">initial position</param>
        /// <param name="activePosition">position now</param>
        /// <returns>if we havent moved 0.5m in the 2 vectors, jump and return true</returns>
        private bool CheckIfWeAreStuckIfYesJump(Vector3 initialPosition, Vector3 activePosition)
        {
            // we are possibly stuck at a fence or something alike
            if (MovedSinceLastTick != 0 && MovedSinceLastTick < 1000)
            {
                if (MovedSinceLastTick < AmeisenDataHolder.Settings.MovementJumpThreshold)
                {
                    AmeisenCore.CharacterJumpAsync();
                    AmeisenLogger.Instance.Log(LogLevel.DEBUG, $"Jumping: {MovedSinceLastTick}", this);
                    return true;
                }
            }

            MovedSinceLastTick = Utils.GetDistance(initialPosition, activePosition);
            return false;
        }