Пример #1
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 faction)
        {
            faction = FactionContext.Push(faction);
            if (faction == null)
            {
                return;
            }

            Multiplayer.WorldComp?.SetFaction(faction);
            map?.MpComp().SetFaction(faction);
        }
Пример #2
0
        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);
        }
Пример #3
0
 static void Prefix(CompForbiddable __instance, ref bool __state)
 {
     FactionContext.Push(Multiplayer.RealPlayerFaction);
     __state = __instance.forbiddenInt;
     __instance.forbiddenInt = __instance.Forbidden;
 }