mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-23 15:36:59 +00:00
nilrider:: fixed loading a level multiple times
This commit is contained in:
parent
29c59a1f26
commit
51c64dec45
@ -620,6 +620,7 @@ void load_level(const string& fname) {
|
||||
}
|
||||
for(auto& l: all_levels) if(l->name == lev.name) {
|
||||
if(l->flags & nrlUserCreated) {
|
||||
cgi.ext.erase("nillevel-" + l->name);
|
||||
swap(*l, lev);
|
||||
curlev = l;
|
||||
if(on) l->init();
|
||||
|
@ -120,7 +120,12 @@ struct level {
|
||||
bool initialized;
|
||||
|
||||
level(string name, char hotkey, flagtype flags, string longdesc, ld minx, ld miny, ld maxx, ld maxy, const vector<string>& mt, ld sx, ld sy, const vector<level*> subs, const std::function<ld(hyperpoint h)>& surf, vector<goal> g) :
|
||||
name(name), hotkey(hotkey), longdesc(longdesc), flags(flags), minx(minx), miny(miny), maxx(maxx), maxy(maxy), map_tiles(mt), startx(sx), starty(sy), sublevels(subs), surface(surf), goals(g) { initialized = false; }
|
||||
name(name), hotkey(hotkey), longdesc(longdesc), flags(flags), minx(minx), miny(miny), maxx(maxx), maxy(maxy), map_tiles(mt), startx(sx), starty(sy), sublevels(subs), surface(surf), goals(g) {
|
||||
initialized = false;
|
||||
unil_texture = nullptr;
|
||||
unil_texture_stepped = nullptr;
|
||||
unil_texture_levels = nullptr;
|
||||
}
|
||||
|
||||
ld real_minx, real_miny, real_maxx, real_maxy;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user