From d1b1ed830bfb99f719ac88ae98843e339c8c5e8e Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 12 Jun 2020 17:24:08 -0700 Subject: [PATCH] Fix ed.currentghosts updating way too fast Just like all the other fixes, the variable that controls the amount of ghosts to show was being updated every render frame instead of every logic frame. --- desktop_version/src/editor.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index e3c1fb24..ded07952 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -2900,12 +2900,6 @@ void editorrender() BlitSurfaceColoured(graphics.sprites[ed.ghosts[i].frame],NULL, graphics.ghostbuffer, &drawRect, graphics.ct); } } - if (ed.currentghosts + 1 < (int)ed.ghosts.size()) { - ed.currentghosts++; - if (ed.zmod) ed.currentghosts++; - } else { - ed.currentghosts = (int)ed.ghosts.size() - 1; - } SDL_BlitSurface(graphics.ghostbuffer, NULL, graphics.backBuffer, &graphics.bg_rect); } @@ -3625,6 +3619,16 @@ void editorlogic() ed.notedelay--; } + if (game.ghostsenabled) + { + if (ed.currentghosts + 1 < (int)ed.ghosts.size()) { + ed.currentghosts++; + if (ed.zmod) ed.currentghosts++; + } else { + ed.currentghosts = (int)ed.ghosts.size() - 1; + } + } + if (!ed.settingsmod) { switch(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir)