<commit_before>﻿using UnityEngine;
using System.Collections;

namespace Lockstep
{
    public class HeightSet : Ability
    {
        [SerializeField]
        private int _mapIndex;

        public int MapIndex { get { return _mapIndex; } }

        [SerializeField, FixedNumber]
        private long _bonusHeight;

        private long _offset;

        [Lockstep(true)]
        public long Offset
        {
            get { return _offset; }
            set
            {
                if (_offset != value)
                {
                    _offset = value;
                    ForceUpdate = true;
                }
            }
        }

        public bool ForceUpdate { get; set; }

        protected override void OnSimulate()
        {
            if (Agent.Body.PositionChanged || Agent.Body.PositionChangedBuffer || ForceUpdate)
            {
                long height = HeightmapHelper.Instance.GetHeight(MapIndex, Agent.Body.Position) + _bonusHeight + Offset;
                Agent.Body.HeightPos = height;
            }
        }
    }
}<commit_msg>Disallow multiple HeightSets<commit_after>﻿using UnityEngine;
using System.Collections;

namespace Lockstep
{
    [UnityEngine.DisallowMultipleComponent]
    public class HeightSet : Ability
    {
        [SerializeField]
        private int _mapIndex;

        public int MapIndex { get { return _mapIndex; } }

        [SerializeField, FixedNumber]
        private long _bonusHeight;

        private long _offset;

        [Lockstep(true)]
        public long Offset
        {
            get { return _offset; }
            set
            {
                if (_offset != value)
                {
                    _offset = value;
                    ForceUpdate = true;
                }
            }
        }

        public bool ForceUpdate { get; set; }

        protected override void OnSimulate()
        {
            if (Agent.Body.PositionChanged || Agent.Body.PositionChangedBuffer || ForceUpdate)
            {
                long height = HeightmapHelper.Instance.GetHeight(MapIndex, Agent.Body.Position) + _bonusHeight + Offset;
                Agent.Body.HeightPos = height;
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.07482993197278912, 'fraction_numerical': 0.0, 'mean_word_length': 1.4758698092031426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4217409', 'n_tokens_mistral': 570, 'n_tokens_neox': 538, 'n_words': 131}