Beispiel #1
0
        private static void Postfix(Fire __instance, string text, ref bool ___m_UseEmbers, EffectsControllerFire ___m_FX, ref FireState ___m_FireState)
        {
            HeatReservoir myreservoir = Fire_RV.GetHeatReservoir(Utils.GetGuidFromGameObject(__instance.gameObject));

            if (myreservoir == null)
            {
                return;
            }
            FireSaveDataProxy fireSaveDataProxy = Utils.DeserializeObject <FireSaveDataProxy>(text);

            float newelapsedtime = fireSaveDataProxy.m_ElapsedOnTODSecondsProxy + (GameManager.GetTimeOfDayComponent().GetHoursPlayedNotPaused() - fireSaveDataProxy.m_HoursPlayed) * 60 * 60;

            float maxburn = fireSaveDataProxy.m_MaxOnTODSecondsProxy;

            if (newelapsedtime > maxburn)
            {
                //fire went out inbetween. log minutes ago into reservoir.
                myreservoir.fireLastOnAt = Fire_RV.unitime() - (newelapsedtime - maxburn) / (60 * 60 * 24);
            }
        }