Example #1
0
        public bool QuadOutOfArea(Quad2 quad)
        {
            if (mode != LoadMode.NewGame && mode != LoadMode.LoadGame && mode != LoadMode.NewGameFromScenario)
            {
                return(false);
            }
            var result = CrossTheLine.IsCrossingLineProhibited();

            if (result)
            {
                do
                {
                }while (!Monitor.TryEnter(_lock, SimulationManager.SYNCHRONIZE_TIMEOUT));
                try
                {
                    RedirectionHelper.RevertJumpTo(_originalPtr, _state);
                    result = Singleton <GameAreaManager> .instance.QuadOutOfArea(quad);

                    RedirectionHelper.PatchJumpTo(_originalPtr, _detourPtr);
                }
                finally
                {
                    Monitor.Exit(_lock);
                }
            }
            return(result);
        }