1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-07 17:23:00 +00:00

nilrider:: do not switch level on saving a usergen level

This commit is contained in:
Zeno Rogue
2024-08-20 19:13:28 +02:00
parent 88b927e4b1
commit da5ba2bf2b
3 changed files with 9 additions and 7 deletions

View File

@@ -579,7 +579,7 @@ void cleanup_textures() {
cleanup_texture(castle_texture);
}
void load_level(const string& fname) {
void load_level(const string& fname, bool init) {
fhstream f(fname, "r");
if(!f.f) throw hr_exception("could not open file ");
level lev("Untitled", '1', nrlUserCreated, "", -1, 1, 1, -1, {}, 0, 0, {}, rot_plane, { goal{0x40FF40, "Collect all the triangles", basic_check(999, 999)} });
@@ -659,9 +659,11 @@ void load_level(const string& fname) {
}
else throw hr_exception("cannot use the same name as an official level");
}
curlev = new level(lev);
all_levels.emplace_back(curlev);
if(on) curlev->init();
if(init) {
curlev = new level(lev);
all_levels.emplace_back(curlev);
if(on) curlev->init();
}
}
}