Remove script.dontrunnextframe kludge

Now that the game loop order is fixed, this kludge (on top of kludge) is
no longer needed, and can be safely removed.
This commit is contained in:
Misa authored and Ethan Lee committed 2021-03-21 02:55:42 -04:00
1 parent c82c2afbbd
commit 585ae47d78
4 files changed
+2 -20

No files matched your search

-2
View File
@@ -2075,6 +2075,4 @@ void mapclass::twoframedelayfix(void)
game.state = 0;
game.statedelay = 0;
script.load(game.newscript);
script.run();
script.dontrunnextframe = true;
}
-5
View File
@@ -18,7 +18,6 @@ scriptclass::scriptclass(void)
position = 0;
scriptdelay = 0;
running = false;
dontrunnextframe = false;
b = 0;
g = 0;
@@ -3492,10 +3491,6 @@ void scriptclass::teleport(void)
game.state = 0;
load(game.teleportscript);
game.teleportscript = "";
// FIXME: Remove this once game loop order is fixed in 2.4!
run();
dontrunnextframe = true;
}
else
{
+1 -1
View File
@@ -54,7 +54,7 @@ public:
int looppoint, loopcount;
int scriptdelay;
bool running, dontrunnextframe;
bool running;
//Textbox stuff
int textx;
+1 -12
View File
@@ -93,18 +93,6 @@ static void runscript(void)
static void gamemodefunc1(void)
{
// WARNING: If updating this code, don't forget to update Map.cpp mapclass::twoframedelayfix()
// Ugh, I hate this kludge variable but it's the only way to do it
if (script.dontrunnextframe)
{
script.dontrunnextframe = false;
}
else
{
runscript();
}
//Update old lerp positions of entities - has to be done BEFORE gameinput!
for (size_t i = 0; i < obj.entities.size(); i++)
{
@@ -158,6 +146,7 @@ static const inline struct ImplFunc* get_gamestate_funcs(
}
FUNC_LIST_BEGIN(GAMEMODE)
{Func_fixed, runscript},
{Func_fixed, gamemodefunc1},
{Func_fixed, gameinput},
{Func_fixed, gamerenderfixed},