diff --git a/CHANGELOG.md b/CHANGELOG.md index 0369bc3de..4b1b8f7ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,6 +98,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Control schemes will no longer get deleted when being configured. Resetting the control scheme will load a preset instead of leaving it blank. ([Issue #121](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/121)) +- Fix glow effects being drawn one frame past `EffectStartTime` making objects that exist for a single frame not draw glows. ([Issue #67](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/67)) + ### Removed - Removed `Settings.ini` property `PixelsPerMeter`. Now hardcoded and cannot be changed by the user. diff --git a/Entities/MOPixel.cpp b/Entities/MOPixel.cpp index 4bd420463..0400a1ed9 100644 --- a/Entities/MOPixel.cpp +++ b/Entities/MOPixel.cpp @@ -245,7 +245,7 @@ namespace RTE { // Set the screen effect to draw at the final post processing stage if (m_pScreenEffect && mode == g_DrawColor && !onlyPhysical) { - if (m_AgeTimer.IsPastSimMS(m_EffectStartTime) && (m_EffectStopTime == 0 || !m_AgeTimer.IsPastSimMS(m_EffectStopTime))) { + if (m_AgeTimer.GetElapsedSimTimeMS() >= m_EffectStartTime && (m_EffectStopTime == 0 || !m_AgeTimer.IsPastSimMS(m_EffectStopTime))) { if (m_EffectAlwaysShows || !g_SceneMan.ObscuredPoint(m_Pos.GetFloorIntX(), m_Pos.GetFloorIntY())) { g_PostProcessMan.RegisterPostEffect(m_Pos, m_pScreenEffect, m_ScreenEffectHash, LERP(m_EffectStartTime, m_EffectStopTime, m_EffectStartStrength, m_EffectStopStrength, m_AgeTimer.GetElapsedSimTimeMS()), m_EffectRotAngle); } diff --git a/Entities/MOSParticle.cpp b/Entities/MOSParticle.cpp index e3e9be806..1cc19139c 100644 --- a/Entities/MOSParticle.cpp +++ b/Entities/MOSParticle.cpp @@ -195,7 +195,7 @@ namespace RTE { // Set the screen effect to draw at the final post processing stage if (m_pScreenEffect && mode == g_DrawColor && !onlyPhysical) { - if (m_AgeTimer.IsPastSimMS(m_EffectStartTime) && (m_EffectStopTime == 0 || !m_AgeTimer.IsPastSimMS(m_EffectStopTime))) { + if (m_AgeTimer.GetElapsedSimTimeMS() >= m_EffectStartTime && (m_EffectStopTime == 0 || !m_AgeTimer.IsPastSimMS(m_EffectStopTime))) { if (m_EffectAlwaysShows || !g_SceneMan.ObscuredPoint(m_Pos.GetFloorIntX(), m_Pos.GetFloorIntY())) { g_PostProcessMan.RegisterPostEffect(m_Pos, m_pScreenEffect, m_ScreenEffectHash, LERP(m_EffectStartTime, m_EffectStopTime, m_EffectStartStrength, m_EffectStopStrength, m_AgeTimer.GetElapsedSimTimeMS()), m_EffectRotAngle); }