示例#1
0
        public static void PopFaction(this Map map)
        {
            Faction faction = FactionContext.Pop();

            if (faction == null)
            {
                return;
            }

            Multiplayer.WorldComp?.SetFaction(faction);
            map?.MpComp().SetFaction(faction);
        }
示例#2
0
        // Sets the current Faction.OfPlayer
        // Applies faction's world components
        // Applies faction's map components if map not null
        public static void PushFaction(this Map map, Faction f)
        {
            var faction = FactionContext.Push(f);

            if (faction == null)
            {
                return;
            }

            Multiplayer.WorldComp?.SetFaction(faction);
            map?.MpComp().SetFaction(faction);
        }
        static void Prefix(DateNotifier __instance, ref int?__state)
        {
            if (Multiplayer.Client == null && Multiplayer.RealPlayerFaction != null)
            {
                return;
            }

            Map map = __instance.FindPlayerHomeWithMinTimezone();

            if (map == null)
            {
                return;
            }

            __state = Find.TickManager.TicksGame;
            FactionContext.Push(Multiplayer.RealPlayerFaction);
            Find.TickManager.DebugSetTicksGame(map.AsyncTime().mapTicks);
        }
示例#4
0
 static void Postfix(CompForbiddable __instance, bool __state)
 {
     __instance.forbiddenInt = __state;
     FactionContext.Pop();
 }
示例#5
0
 static void Prefix(CompForbiddable __instance, ref bool __state)
 {
     FactionContext.Push(Multiplayer.RealPlayerFaction);
     __state = __instance.forbiddenInt;
     __instance.forbiddenInt = __instance.Forbidden;
 }