diff --git a/rogueviz/nilrider/level.cpp b/rogueviz/nilrider/level.cpp index b0b401b9..aacd07cc 100644 --- a/rogueviz/nilrider/level.cpp +++ b/rogueviz/nilrider/level.cpp @@ -631,10 +631,10 @@ void load_level(const string& fname) { }; } else if(cmd == "LAYER") { - auto n = new level(lev); - n->name = param; - lev.sublevels.push_back(n); - n->map_tiles = {}; + csub = new level(lev); + csub->name = param; + lev.sublevels.push_back(csub); + csub->map_tiles = {}; } } if(lev.startx < 0 || lev.starty < 0 || lev.starty >= isize(lev.map_tiles) || lev.startx >= isize(lev.map_tiles[0])) diff --git a/rogueviz/nilrider/sample.nrl b/rogueviz/nilrider/sample.nrl index bdece705..31112f53 100644 --- a/rogueviz/nilrider/sample.nrl +++ b/rogueviz/nilrider/sample.nrl @@ -60,3 +60,7 @@ FUNCTION exp(-x*x-y*y) # if you need more layers: enter 'LAYER ' then describe the layer, using the same format, except DESC and START are irrelevant. # MAP is necessary. FUNCTION and BOUNDS will be copied from the main layer if not provided. + +LAYER below +MAP F +FUNCTION -1