Remove global 'temp' variable from titlerender.cpp

Just a miscellaneous code cleanup.

There's no glitches that take advantage of the previous situation,
namely that 'temp' was a global variable in Logic.cpp and editor.cpp.
Even if there were, it seems like it would easily lead to some undefined
behavior. So it's good to clean this up.
This commit is contained in:
Misa
2020-04-02 18:50:37 -07:00
committed by Ethan Lee
parent d3cdd33605
commit 04d14000ec
4 changed files with 17 additions and 24 deletions

View File

@@ -2,7 +2,6 @@
#include "Script.h"
#include "Network.h"
extern int temp;
extern scriptclass script;
void titlelogic()
@@ -678,7 +677,7 @@ void gamelogic()
if (map.final_colorframe == 1)
{
map.final_colorframedelay = 40;
temp = 1+int(fRandom() * 6);
int temp = 1+int(fRandom() * 6);
if (temp == map.final_mapcol) temp = (temp + 1) % 6;
if (temp == 0) temp = 6;
map.changefinalcol(temp);
@@ -686,7 +685,7 @@ void gamelogic()
else if (map.final_colorframe == 2)
{
map.final_colorframedelay = 15;
temp = 1+int(fRandom() * 6);
int temp = 1+int(fRandom() * 6);
if (temp == map.final_mapcol) temp = (temp + 1) % 6;
if (temp == 0) temp = 6;
map.changefinalcol(temp);