1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-09 18:39:45 +01:00

Replace all usages of atoi() with help.Int()

This will prevent any undefined behavior that might occur as a result of
having invalid input passed into atoi().
This commit is contained in:
Misa 2020-08-06 21:31:29 -07:00 committed by Ethan Lee
parent 037065910f
commit 78e87effe7
4 changed files with 129 additions and 129 deletions

View file

@ -508,7 +508,7 @@ void Game::loadcustomlevelstats()
if (stat_el->GetText() != NULL) if (stat_el->GetText() != NULL)
{ {
stat.score = atoi(stat_el->GetText()); stat.score = help.Int(stat_el->GetText());
} }
if (stat_el->Attribute("name")) if (stat_el->Attribute("name"))
@ -542,7 +542,7 @@ void Game::loadcustomlevelstats()
std::vector<std::string> values = split(TextString,','); std::vector<std::string> values = split(TextString,',');
for(size_t i = 0; i < values.size(); i++) for(size_t i = 0; i < values.size(); i++)
{ {
customlevelscores.push_back(atoi(values[i].c_str())); customlevelscores.push_back(help.Int(values[i].c_str()));
} }
} }
} }
@ -4312,7 +4312,7 @@ void Game::unlocknum( int t )
std::vector<std::string> values = split(TextString, ','); \ std::vector<std::string> values = split(TextString, ','); \
for (size_t i = 0; i < SDL_min(SDL_arraysize(DEST), values.size()); i++) \ for (size_t i = 0; i < SDL_min(SDL_arraysize(DEST), values.size()); i++) \
{ \ { \
DEST[i] = atoi(values[i].c_str()); \ DEST[i] = help.Int(values[i].c_str()); \
} \ } \
} \ } \
} }
@ -4371,62 +4371,62 @@ void Game::loadstats(int *width, int *height, bool *vsync)
if (pKey == "bestgamedeaths") if (pKey == "bestgamedeaths")
{ {
bestgamedeaths = atoi(pText); bestgamedeaths = help.Int(pText);
} }
if (pKey == "stat_trinkets") if (pKey == "stat_trinkets")
{ {
stat_trinkets = atoi(pText); stat_trinkets = help.Int(pText);
} }
if (pKey == "fullscreen") if (pKey == "fullscreen")
{ {
fullscreen = atoi(pText); fullscreen = help.Int(pText);
} }
if (pKey == "stretch") if (pKey == "stretch")
{ {
stretchMode = atoi(pText); stretchMode = help.Int(pText);
} }
if (pKey == "useLinearFilter") if (pKey == "useLinearFilter")
{ {
useLinearFilter = atoi(pText); useLinearFilter = help.Int(pText);
} }
if (pKey == "window_width") if (pKey == "window_width")
{ {
*width = atoi(pText); *width = help.Int(pText);
} }
if (pKey == "window_height") if (pKey == "window_height")
{ {
*height = atoi(pText); *height = help.Int(pText);
} }
if (pKey == "noflashingmode") if (pKey == "noflashingmode")
{ {
noflashingmode = atoi(pText); noflashingmode = help.Int(pText);
} }
if (pKey == "colourblindmode") if (pKey == "colourblindmode")
{ {
colourblindmode = atoi(pText); colourblindmode = help.Int(pText);
} }
if (pKey == "setflipmode") if (pKey == "setflipmode")
{ {
graphics.setflipmode = atoi(pText); graphics.setflipmode = help.Int(pText);
} }
if (pKey == "invincibility") if (pKey == "invincibility")
{ {
map.invincibility = atoi(pText); map.invincibility = help.Int(pText);
} }
if (pKey == "slowdown") if (pKey == "slowdown")
{ {
slowdown = atoi(pText); slowdown = help.Int(pText);
switch(slowdown) switch(slowdown)
{ {
case 30: case 30:
@ -4450,22 +4450,22 @@ void Game::loadstats(int *width, int *height, bool *vsync)
if (pKey == "swnbestrank") if (pKey == "swnbestrank")
{ {
swnbestrank = atoi(pText); swnbestrank = help.Int(pText);
} }
if (pKey == "swnrecord") if (pKey == "swnrecord")
{ {
swnrecord = atoi(pText); swnrecord = help.Int(pText);
} }
if (pKey == "advanced_smoothing") if (pKey == "advanced_smoothing")
{ {
fullScreenEffect_badSignal = atoi(pText); fullScreenEffect_badSignal = help.Int(pText);
} }
if (pKey == "usingmmmmmm") if (pKey == "usingmmmmmm")
{ {
if(atoi(pText)>0){ if(help.Int(pText)>0){
usingmmmmmm = 1; usingmmmmmm = 1;
}else{ }else{
usingmmmmmm = 0; usingmmmmmm = 0;
@ -4474,47 +4474,47 @@ void Game::loadstats(int *width, int *height, bool *vsync)
if (pKey == "ghostsenabled") if (pKey == "ghostsenabled")
{ {
ghostsenabled = atoi(pText); ghostsenabled = help.Int(pText);
} }
if (pKey == "skipfakeload") if (pKey == "skipfakeload")
{ {
skipfakeload = atoi(pText); skipfakeload = help.Int(pText);
} }
if (pKey == "disablepause") if (pKey == "disablepause")
{ {
disablepause = atoi(pText); disablepause = help.Int(pText);
} }
if (pKey == "over30mode") if (pKey == "over30mode")
{ {
over30mode = atoi(pText); over30mode = help.Int(pText);
} }
if (pKey == "glitchrunnermode") if (pKey == "glitchrunnermode")
{ {
glitchrunnermode = atoi(pText); glitchrunnermode = help.Int(pText);
} }
if (pKey == "vsync") if (pKey == "vsync")
{ {
*vsync = atoi(pText); *vsync = help.Int(pText);
} }
if (pKey == "notextoutline") if (pKey == "notextoutline")
{ {
graphics.notextoutline = atoi(pText); graphics.notextoutline = help.Int(pText);
} }
if (pKey == "translucentroomname") if (pKey == "translucentroomname")
{ {
graphics.translucentroomname = atoi(pText); graphics.translucentroomname = help.Int(pText);
} }
if (pKey == "showmousecursor") if (pKey == "showmousecursor")
{ {
graphics.showmousecursor = atoi(pText); graphics.showmousecursor = help.Int(pText);
} }
if (pKey == "flipButton") if (pKey == "flipButton")
@ -4546,7 +4546,7 @@ void Game::loadstats(int *width, int *height, bool *vsync)
if (pKey == "controllerSensitivity") if (pKey == "controllerSensitivity")
{ {
controllerSensitivity = atoi(pText); controllerSensitivity = help.Int(pText);
} }
} }
@ -5064,56 +5064,56 @@ void Game::loadquick()
if (pKey == "finalmode") if (pKey == "finalmode")
{ {
map.finalmode = atoi(pText); map.finalmode = help.Int(pText);
} }
if (pKey == "finalstretch") if (pKey == "finalstretch")
{ {
map.finalstretch = atoi(pText); map.finalstretch = help.Int(pText);
} }
if (pKey == "finalx") if (pKey == "finalx")
{ {
map.finalx = atoi(pText); map.finalx = help.Int(pText);
} }
else if (pKey == "finaly") else if (pKey == "finaly")
{ {
map.finaly = atoi(pText); map.finaly = help.Int(pText);
} }
else if (pKey == "savex") else if (pKey == "savex")
{ {
savex = atoi(pText); savex = help.Int(pText);
} }
else if (pKey == "savey") else if (pKey == "savey")
{ {
savey = atoi(pText); savey = help.Int(pText);
} }
else if (pKey == "saverx") else if (pKey == "saverx")
{ {
saverx = atoi(pText); saverx = help.Int(pText);
} }
else if (pKey == "savery") else if (pKey == "savery")
{ {
savery = atoi(pText); savery = help.Int(pText);
} }
else if (pKey == "savegc") else if (pKey == "savegc")
{ {
savegc = atoi(pText); savegc = help.Int(pText);
} }
else if (pKey == "savedir") else if (pKey == "savedir")
{ {
savedir= atoi(pText); savedir= help.Int(pText);
} }
else if (pKey == "savepoint") else if (pKey == "savepoint")
{ {
savepoint = atoi(pText); savepoint = help.Int(pText);
} }
else if (pKey == "companion") else if (pKey == "companion")
{ {
companion = atoi(pText); companion = help.Int(pText);
} }
else if (pKey == "lastsaved") else if (pKey == "lastsaved")
{ {
lastsaved = atoi(pText); lastsaved = help.Int(pText);
} }
else if (pKey == "teleportscript") else if (pKey == "teleportscript")
{ {
@ -5121,40 +5121,40 @@ void Game::loadquick()
} }
else if (pKey == "supercrewmate") else if (pKey == "supercrewmate")
{ {
supercrewmate = atoi(pText); supercrewmate = help.Int(pText);
} }
else if (pKey == "scmprogress") else if (pKey == "scmprogress")
{ {
scmprogress = atoi(pText); scmprogress = help.Int(pText);
} }
else if (pKey == "scmmoveme") else if (pKey == "scmmoveme")
{ {
scmmoveme = atoi(pText); scmmoveme = help.Int(pText);
} }
else if (pKey == "frames") else if (pKey == "frames")
{ {
frames = atoi(pText); frames = help.Int(pText);
frames = 0; frames = 0;
} }
else if (pKey == "seconds") else if (pKey == "seconds")
{ {
seconds = atoi(pText); seconds = help.Int(pText);
} }
else if (pKey == "minutes") else if (pKey == "minutes")
{ {
minutes = atoi(pText); minutes = help.Int(pText);
} }
else if (pKey == "hours") else if (pKey == "hours")
{ {
hours = atoi(pText); hours = help.Int(pText);
} }
else if (pKey == "deathcounts") else if (pKey == "deathcounts")
{ {
deathcounts = atoi(pText); deathcounts = help.Int(pText);
} }
else if (pKey == "totalflips") else if (pKey == "totalflips")
{ {
totalflips = atoi(pText); totalflips = help.Int(pText);
} }
else if (pKey == "hardestroom") else if (pKey == "hardestroom")
{ {
@ -5162,11 +5162,11 @@ void Game::loadquick()
} }
else if (pKey == "hardestroomdeaths") else if (pKey == "hardestroomdeaths")
{ {
hardestroomdeaths = atoi(pText); hardestroomdeaths = help.Int(pText);
} }
else if (pKey == "currentsong") else if (pKey == "currentsong")
{ {
int song = atoi(pText); int song = help.Int(pText);
if (song != -1) if (song != -1)
{ {
music.play(song); music.play(song);
@ -5252,11 +5252,11 @@ void Game::customloadquick(std::string savfile)
if (pKey == "finalmode") if (pKey == "finalmode")
{ {
map.finalmode = atoi(pText); map.finalmode = help.Int(pText);
} }
if (pKey == "finalstretch") if (pKey == "finalstretch")
{ {
map.finalstretch = atoi(pText); map.finalstretch = help.Int(pText);
} }
if (map.finalmode) if (map.finalmode)
@ -5276,47 +5276,47 @@ void Game::customloadquick(std::string savfile)
if (pKey == "finalx") if (pKey == "finalx")
{ {
map.finalx = atoi(pText); map.finalx = help.Int(pText);
} }
else if (pKey == "finaly") else if (pKey == "finaly")
{ {
map.finaly = atoi(pText); map.finaly = help.Int(pText);
} }
else if (pKey == "savex") else if (pKey == "savex")
{ {
savex = atoi(pText); savex = help.Int(pText);
} }
else if (pKey == "savey") else if (pKey == "savey")
{ {
savey = atoi(pText); savey = help.Int(pText);
} }
else if (pKey == "saverx") else if (pKey == "saverx")
{ {
saverx = atoi(pText); saverx = help.Int(pText);
} }
else if (pKey == "savery") else if (pKey == "savery")
{ {
savery = atoi(pText); savery = help.Int(pText);
} }
else if (pKey == "savegc") else if (pKey == "savegc")
{ {
savegc = atoi(pText); savegc = help.Int(pText);
} }
else if (pKey == "savedir") else if (pKey == "savedir")
{ {
savedir= atoi(pText); savedir= help.Int(pText);
} }
else if (pKey == "savepoint") else if (pKey == "savepoint")
{ {
savepoint = atoi(pText); savepoint = help.Int(pText);
} }
else if (pKey == "companion") else if (pKey == "companion")
{ {
companion = atoi(pText); companion = help.Int(pText);
} }
else if (pKey == "lastsaved") else if (pKey == "lastsaved")
{ {
lastsaved = atoi(pText); lastsaved = help.Int(pText);
} }
else if (pKey == "teleportscript") else if (pKey == "teleportscript")
{ {
@ -5324,40 +5324,40 @@ void Game::customloadquick(std::string savfile)
} }
else if (pKey == "supercrewmate") else if (pKey == "supercrewmate")
{ {
supercrewmate = atoi(pText); supercrewmate = help.Int(pText);
} }
else if (pKey == "scmprogress") else if (pKey == "scmprogress")
{ {
scmprogress = atoi(pText); scmprogress = help.Int(pText);
} }
else if (pKey == "scmmoveme") else if (pKey == "scmmoveme")
{ {
scmmoveme = atoi(pText); scmmoveme = help.Int(pText);
} }
else if (pKey == "frames") else if (pKey == "frames")
{ {
frames = atoi(pText); frames = help.Int(pText);
frames = 0; frames = 0;
} }
else if (pKey == "seconds") else if (pKey == "seconds")
{ {
seconds = atoi(pText); seconds = help.Int(pText);
} }
else if (pKey == "minutes") else if (pKey == "minutes")
{ {
minutes = atoi(pText); minutes = help.Int(pText);
} }
else if (pKey == "hours") else if (pKey == "hours")
{ {
hours = atoi(pText); hours = help.Int(pText);
} }
else if (pKey == "deathcounts") else if (pKey == "deathcounts")
{ {
deathcounts = atoi(pText); deathcounts = help.Int(pText);
} }
else if (pKey == "totalflips") else if (pKey == "totalflips")
{ {
totalflips = atoi(pText); totalflips = help.Int(pText);
} }
else if (pKey == "hardestroom") else if (pKey == "hardestroom")
{ {
@ -5365,11 +5365,11 @@ void Game::customloadquick(std::string savfile)
} }
else if (pKey == "hardestroomdeaths") else if (pKey == "hardestroomdeaths")
{ {
hardestroomdeaths = atoi(pText); hardestroomdeaths = help.Int(pText);
} }
else if (pKey == "currentsong") else if (pKey == "currentsong")
{ {
int song = atoi(pText); int song = help.Int(pText);
if (song != -1) if (song != -1)
{ {
music.play(song); music.play(song);
@ -5377,7 +5377,7 @@ void Game::customloadquick(std::string savfile)
} }
else if (pKey == "showminimap") else if (pKey == "showminimap")
{ {
map.customshowmm = atoi(pText); map.customshowmm = help.Int(pText);
} }
} }
@ -5428,35 +5428,35 @@ void Game::loadsummary()
else if (pKey == "seconds") else if (pKey == "seconds")
{ {
l_second = atoi(pText); l_second = help.Int(pText);
} }
else if (pKey == "minutes") else if (pKey == "minutes")
{ {
l_minute = atoi(pText); l_minute = help.Int(pText);
} }
else if (pKey == "hours") else if (pKey == "hours")
{ {
l_hours = atoi(pText); l_hours = help.Int(pText);
} }
else if (pKey == "savery") else if (pKey == "savery")
{ {
l_saveY = atoi(pText); l_saveY = help.Int(pText);
} }
else if (pKey == "saverx") else if (pKey == "saverx")
{ {
l_saveX = atoi(pText); l_saveX = help.Int(pText);
} }
else if (pKey == "trinkets") else if (pKey == "trinkets")
{ {
tele_trinkets = atoi(pText); tele_trinkets = help.Int(pText);
} }
else if (pKey == "finalmode") else if (pKey == "finalmode")
{ {
map.finalmode = atoi(pText); map.finalmode = help.Int(pText);
} }
else if (pKey == "finalstretch") else if (pKey == "finalstretch")
{ {
map.finalstretch = atoi(pText); map.finalstretch = help.Int(pText);
} }
LOAD_ARRAY_RENAME(crewstats, tele_crewstats) LOAD_ARRAY_RENAME(crewstats, tele_crewstats)
@ -5505,35 +5505,35 @@ void Game::loadsummary()
else if (pKey == "seconds") else if (pKey == "seconds")
{ {
l_second = atoi(pText); l_second = help.Int(pText);
} }
else if (pKey == "minutes") else if (pKey == "minutes")
{ {
l_minute = atoi(pText); l_minute = help.Int(pText);
} }
else if (pKey == "hours") else if (pKey == "hours")
{ {
l_hours = atoi(pText); l_hours = help.Int(pText);
} }
else if (pKey == "savery") else if (pKey == "savery")
{ {
l_saveY = atoi(pText); l_saveY = help.Int(pText);
} }
else if (pKey == "saverx") else if (pKey == "saverx")
{ {
l_saveX = atoi(pText); l_saveX = help.Int(pText);
} }
else if (pKey == "trinkets") else if (pKey == "trinkets")
{ {
quick_trinkets = atoi(pText); quick_trinkets = help.Int(pText);
} }
else if (pKey == "finalmode") else if (pKey == "finalmode")
{ {
map.finalmode = atoi(pText); map.finalmode = help.Int(pText);
} }
else if (pKey == "finalstretch") else if (pKey == "finalstretch")
{ {
map.finalstretch = atoi(pText); map.finalstretch = help.Int(pText);
} }
LOAD_ARRAY_RENAME(crewstats, quick_crewstats) LOAD_ARRAY_RENAME(crewstats, quick_crewstats)
@ -6206,11 +6206,11 @@ void Game::loadtele()
if (pKey == "finalmode") if (pKey == "finalmode")
{ {
map.finalmode = atoi(pText); map.finalmode = help.Int(pText);
} }
if (pKey == "finalstretch") if (pKey == "finalstretch")
{ {
map.finalstretch = atoi(pText); map.finalstretch = help.Int(pText);
} }
if (map.finalmode) if (map.finalmode)
@ -6230,47 +6230,47 @@ void Game::loadtele()
if (pKey == "finalx") if (pKey == "finalx")
{ {
map.finalx = atoi(pText); map.finalx = help.Int(pText);
} }
else if (pKey == "finaly") else if (pKey == "finaly")
{ {
map.finaly = atoi(pText); map.finaly = help.Int(pText);
} }
else if (pKey == "savex") else if (pKey == "savex")
{ {
savex = atoi(pText); savex = help.Int(pText);
} }
else if (pKey == "savey") else if (pKey == "savey")
{ {
savey = atoi(pText); savey = help.Int(pText);
} }
else if (pKey == "saverx") else if (pKey == "saverx")
{ {
saverx = atoi(pText); saverx = help.Int(pText);
} }
else if (pKey == "savery") else if (pKey == "savery")
{ {
savery = atoi(pText); savery = help.Int(pText);
} }
else if (pKey == "savegc") else if (pKey == "savegc")
{ {
savegc = atoi(pText); savegc = help.Int(pText);
} }
else if (pKey == "savedir") else if (pKey == "savedir")
{ {
savedir= atoi(pText); savedir= help.Int(pText);
} }
else if (pKey == "savepoint") else if (pKey == "savepoint")
{ {
savepoint = atoi(pText); savepoint = help.Int(pText);
} }
else if (pKey == "companion") else if (pKey == "companion")
{ {
companion = atoi(pText); companion = help.Int(pText);
} }
else if (pKey == "lastsaved") else if (pKey == "lastsaved")
{ {
lastsaved = atoi(pText); lastsaved = help.Int(pText);
} }
else if (pKey == "teleportscript") else if (pKey == "teleportscript")
{ {
@ -6278,40 +6278,40 @@ void Game::loadtele()
} }
else if (pKey == "supercrewmate") else if (pKey == "supercrewmate")
{ {
supercrewmate = atoi(pText); supercrewmate = help.Int(pText);
} }
else if (pKey == "scmprogress") else if (pKey == "scmprogress")
{ {
scmprogress = atoi(pText); scmprogress = help.Int(pText);
} }
else if (pKey == "scmmoveme") else if (pKey == "scmmoveme")
{ {
scmmoveme = atoi(pText); scmmoveme = help.Int(pText);
} }
else if (pKey == "frames") else if (pKey == "frames")
{ {
frames = atoi(pText); frames = help.Int(pText);
frames = 0; frames = 0;
} }
else if (pKey == "seconds") else if (pKey == "seconds")
{ {
seconds = atoi(pText); seconds = help.Int(pText);
} }
else if (pKey == "minutes") else if (pKey == "minutes")
{ {
minutes = atoi(pText); minutes = help.Int(pText);
} }
else if (pKey == "hours") else if (pKey == "hours")
{ {
hours = atoi(pText); hours = help.Int(pText);
} }
else if (pKey == "deathcounts") else if (pKey == "deathcounts")
{ {
deathcounts = atoi(pText); deathcounts = help.Int(pText);
} }
else if (pKey == "totalflips") else if (pKey == "totalflips")
{ {
totalflips = atoi(pText); totalflips = help.Int(pText);
} }
else if (pKey == "hardestroom") else if (pKey == "hardestroom")
{ {
@ -6319,11 +6319,11 @@ void Game::loadtele()
} }
else if (pKey == "hardestroomdeaths") else if (pKey == "hardestroomdeaths")
{ {
hardestroomdeaths = atoi(pText); hardestroomdeaths = help.Int(pText);
} }
else if (pKey == "currentsong") else if (pKey == "currentsong")
{ {
int song = atoi(pText); int song = help.Int(pText);
if (song != -1) if (song != -1)
{ {
music.play(song); music.play(song);

View file

@ -3974,7 +3974,7 @@ void scriptclass::loadcustom(const std::string& t)
add("text(blue,0,0,"+words[1]+")"); add("text(blue,0,0,"+words[1]+")");
break; break;
} }
int ti=atoi(words[1].c_str()); int ti=help.Int(words[1].c_str());
int nti = ti>=0 && ti<=50 ? ti : 1; int nti = ti>=0 && ti<=50 ? ti : 1;
for(int ti2=0; ti2<nti; ti2++){ for(int ti2=0; ti2<nti; ti2++){
i++; i++;
@ -3999,7 +3999,7 @@ void scriptclass::loadcustom(const std::string& t)
if(squeakmode==0) add("squeak(player)"); if(squeakmode==0) add("squeak(player)");
add("text(cyan,0,0,"+words[1]+")"); add("text(cyan,0,0,"+words[1]+")");
int ti=atoi(words[1].c_str()); int ti=help.Int(words[1].c_str());
int nti = ti>=0 && ti<=50 ? ti : 1; int nti = ti>=0 && ti<=50 ? ti : 1;
for(int ti2=0; ti2<nti; ti2++){ for(int ti2=0; ti2<nti; ti2++){
i++; i++;

View file

@ -1801,22 +1801,22 @@ bool editorclass::load(std::string& _path)
if(pKey == "onewaycol_override") if(pKey == "onewaycol_override")
{ {
onewaycol_override = atoi(pText); onewaycol_override = help.Int(pText);
} }
} }
} }
if (pKey == "mapwidth") if (pKey == "mapwidth")
{ {
mapwidth = atoi(pText); mapwidth = help.Int(pText);
} }
if (pKey == "mapheight") if (pKey == "mapheight")
{ {
mapheight = atoi(pText); mapheight = help.Int(pText);
} }
if (pKey == "levmusic") if (pKey == "levmusic")
{ {
levmusic = atoi(pText); levmusic = help.Int(pText);
} }
@ -1831,7 +1831,7 @@ bool editorclass::load(std::string& _path)
int y =0; int y =0;
for(size_t i = 0; i < values.size(); i++) for(size_t i = 0; i < values.size(); i++)
{ {
contents[x + (maxwidth*40*y)] = atoi(values[i].c_str()); contents[x + (maxwidth*40*y)] = help.Int(values[i].c_str());
x++; x++;
if(x == mapwidth*40) if(x == mapwidth*40)
{ {
@ -1853,7 +1853,7 @@ bool editorclass::load(std::string& _path)
contents.clear(); contents.clear();
for(int i = 0; i < values.size(); i++) for(int i = 0; i < values.size(); i++)
{ {
contents.push_back(atoi(values[i].c_str())); contents.push_back(help.Int(values[i].c_str()));
} }
} }
} }
@ -4233,8 +4233,8 @@ void editorinput()
ed.notedelay = 45; ed.notedelay = 45;
break; break;
} }
ed.levx = clamp(atoi(coords[0].c_str()) - 1, 0, ed.mapwidth - 1); ed.levx = clamp(help.Int(coords[0].c_str()) - 1, 0, ed.mapwidth - 1);
ed.levy = clamp(atoi(coords[1].c_str()) - 1, 0, ed.mapheight - 1); ed.levy = clamp(help.Int(coords[1].c_str()) - 1, 0, ed.mapheight - 1);
graphics.backgrounddrawn = false; graphics.backgrounddrawn = false;
break; break;
} }

View file

@ -114,7 +114,7 @@ int main(int argc, char *argv[])
{ {
ARG_INNER({ ARG_INNER({
savefileplaytest = true; savefileplaytest = true;
int v = std::atoi(argv[i+1]); int v = help.Int(argv[i+1]);
if (ARG("-playx")) savex = v; if (ARG("-playx")) savex = v;
else if (ARG("-playy")) savey = v; else if (ARG("-playy")) savey = v;
else if (ARG("-playrx")) saverx = v; else if (ARG("-playrx")) saverx = v;