Ejemplo n.º 1
0
        public void StartErrorRecoverJob(string message)
        {
            var text = message; //+ " lastJobGiver=" + caravan.mindState.lastJobGiver;

            if (curJob != null)
            {
                text += ", curJob.def=" + curJob.def.defName;
            }
            if (curDriver != null)
            {
                text += ", curDriver=" + curDriver.GetType();
            }
            Log.Error(text);
            if (curJob != null)
            {
                EndCurrentJob(JobCondition.Errored, false);
            }
            //if (startingErrorRecoverJob)
            //{
            //    Log.Error(
            //        "An error occurred while starting an error recover job. We have to stop now to avoid infinite loops. " +
            //        "This means that the Caravan is now jobless which can cause further bugs. Caravan=" +
            //        caravan.ToStringSafe());
            //}
            //else
            //{
            //    startingErrorRecoverJob = true;
            //    try
            //    {
            //        StartJob(JobMaker.MakeJob(JobDefOf.Wait, 150));
            //    }
            //    finally
            //    {
            //        startingErrorRecoverJob = false;
            //    }
            //}
        }
Ejemplo n.º 2
0
        public void StartErrorRecoverJob(string message)
        {
            var text = message; //+ " lastJobGiver=" + this.caravan.mindState.lastJobGiver;

            if (curJob != null)
            {
                text = text + ", curJob.def=" + curJob.def.defName;
            }
            if (curDriver != null)
            {
                text = text + ", curDriver=" + curDriver.GetType();
            }
            Log.Error(text);
            if (curJob != null)
            {
                EndCurrentJob(JobCondition.Errored, false);
            }
            if (startingErrorRecoverJob)
            {
                Log.Error(
                    "An error occurred while starting an error recover job. We have to stop now to avoid infinite loops. This means that the Caravan is now jobless which can cause further bugs. Caravan=" +
                    caravan.ToStringSafe());
            }
            else
            {
                startingErrorRecoverJob = true;
                try
                {
                    //this.StartJob(new Job(JobDefOf.Wait, 150, false), JobCondition.None, null, false, true, null, null);
                }
                finally
                {
                    startingErrorRecoverJob = false;
                }
            }
        }