Ejemplo n.º 1
0
        private static IEnumerator OnJournalEnter(On.Celeste.OuiJournal.orig_Enter orig, OuiJournal self, Oui from)
        {
            IEnumerator origc = orig(self, from);

            SaveData save      = SaveData.Instance;
            AreaData forceArea = new DynData <Overworld>(self.Overworld).Get <AreaData>("collabInGameForcedArea");

            if (forceArea != null)
            {
                lastArea      = save.LastArea;
                save.LastArea = forceArea.ToKey();
            }

            while (origc.MoveNext())
            {
                yield return(origc.Current);
            }

            if (forceArea != null && lastArea != null)
            {
                save.LastArea = lastArea.Value;
                lastArea      = null;
            }
        }