Example #1
0
        private static bool Prefix(Fire __instance, Campfire ___m_Campfire, float ___m_MaxOnTODSeconds, ref float ___m_ElapsedOnTODSeconds)
        {
            var setting = Fire_RVSettings.Instance;

            if (___m_Campfire && !___m_Campfire.CanFeedFire())
            {
                return(false);
            }
            if (!setting.WindReworked)
            {
                if (__instance.FireShouldBlowOutFromWind())
                {
                    float num      = Mathf.Clamp(___m_MaxOnTODSeconds - ___m_ElapsedOnTODSeconds, 0f, float.PositiveInfinity);
                    float safezone = GameManager.GetFireManagerComponent().m_TODMinutesFadeOutFireAudio * 60f;

                    if (num > safezone)
                    {
                        Fire_RV.breakdownFire(__instance);
                    }
                }
            }
            else
            {
                if (!___m_Campfire)
                {
                    return(false);
                }

                Vector3 position = __instance.transform.position;
                position.y += 1f;
                if (!GameManager.GetWindComponent().IsPositionOccludedFromWind(position))
                {
                    if (Fire_RV.ReworkedFireBlowOut(___m_MaxOnTODSeconds, ___m_ElapsedOnTODSeconds, __instance.GetCurrentTempIncrease()))
                    {
                        Fire_RV.breakdownFire(__instance);
                    }
                }
            }


            return(false);
        }