1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 01:20:37 +00:00

fixed crash happening sometimes when loading a different geometry

This commit is contained in:
Zeno Rogue 2017-11-07 14:39:54 +01:00
parent f5a8b2a0c2
commit 908d581c15

View File

@ -166,6 +166,7 @@ namespace mapstream {
bool loadMap(const char *fname) { bool loadMap(const char *fname) {
f = fopen(fname, "rb"); f = fopen(fname, "rb");
if(!f) return false; if(!f) return false;
clearMemory();
int vernum = loadInt(); int vernum = loadInt();
printf("vernum = %d\n", vernum); printf("vernum = %d\n", vernum);
if(vernum >= 7400) load(mapeditor::whichPattern); if(vernum >= 7400) load(mapeditor::whichPattern);
@ -191,7 +192,6 @@ namespace mapstream {
resetGeometry(); resetGeometry();
clearMemory();
initcells(); initcells();
if(shmup::on) shmup::init(); if(shmup::on) shmup::init();