mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 18:04:09 +03:00
Remove semi-useless function editorclass::weirdloadthing()
Looks like this function was created because editorclass::load() takes in a string by reference, not by value, and thus mutates it afterwards, so if you passed a string in when you didn't want it to be mutated, bad things would happen. However, a better workaround for the above issue would simply to duplicate the string and pass that string instead, thus the original string wouldn't be affected.
This commit is contained in:
@@ -3221,9 +3221,11 @@ void scriptclass::startgamemode( int t )
|
||||
//load("intro");
|
||||
break;
|
||||
case 22: //play custom level (in game)
|
||||
{
|
||||
//Initilise the level
|
||||
//First up, find the start point
|
||||
ed.weirdloadthing(ed.ListOfMetaData[game.playcustomlevel].filename);
|
||||
std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename);
|
||||
ed.load(filename);
|
||||
ed.findstartpoint();
|
||||
|
||||
game.gamestate = GAMEMODE;
|
||||
@@ -3263,10 +3265,13 @@ void scriptclass::startgamemode( int t )
|
||||
graphics.fademode = 4;
|
||||
//load("intro");
|
||||
break;
|
||||
}
|
||||
case 23: //Continue in custom level
|
||||
{
|
||||
//Initilise the level
|
||||
//First up, find the start point
|
||||
ed.weirdloadthing(ed.ListOfMetaData[game.playcustomlevel].filename);
|
||||
std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename);
|
||||
ed.load(filename);
|
||||
ed.findstartpoint();
|
||||
|
||||
game.gamestate = GAMEMODE;
|
||||
@@ -3309,6 +3314,7 @@ void scriptclass::startgamemode( int t )
|
||||
graphics.fademode = 4;
|
||||
//load("intro");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case 100:
|
||||
game.savestats();
|
||||
|
||||
Reference in New Issue
Block a user