Example #1
0
            /// <summary>
            /// If fire source is configured to keep fire source lit, reset time since being lit to 0
            /// </summary>
            private static void Postfix(ref double __result, ref Fireplace __instance)
            {
                if (!Configuration.Current.FireSource.IsEnabled)
                {
                    return;
                }

                if (FireplaceExtensions.IsTorch(__instance.m_name))
                {
                    if (Configuration.Current.FireSource.torches)
                    {
                        __result = 0.0;
                    }
                }
                else if (Configuration.Current.FireSource.fires)
                {
                    __result = 0.0;
                }
            }
Example #2
0
            /// <summary>
            /// When fire source is loaded in view, check for configurations and set its start fuel and current fuel to max fuel
            /// </summary>
            private static void Postfix(ref Fireplace __instance)
            {
                if (!Configuration.Current.FireSource.IsEnabled || !__instance.m_nview || __instance.m_nview.m_zdo == null)
                {
                    return;
                }

                if (FireplaceExtensions.IsTorch(__instance.m_nview.GetPrefabName()))
                {
                    if (Configuration.Current.FireSource.torches)
                    {
                        __instance.m_startFuel = __instance.m_maxFuel;
                        __instance.m_nview.GetZDO().Set("fuel", __instance.m_maxFuel);
                    }
                }
                else if (Configuration.Current.FireSource.fires)
                {
                    __instance.m_startFuel = __instance.m_maxFuel;
                    __instance.m_nview.GetZDO().Set("fuel", __instance.m_maxFuel);
                }
            }