From e47f4fbba5dbd4ca8cedf6b1508e7ef184aed0ef Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 4 Apr 2021 14:26:39 +0200 Subject: [PATCH] throw exception in mapeditor while saving with no parent --- mapeditor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mapeditor.cpp b/mapeditor.cpp index 63f36e75..ca3209e0 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -650,14 +650,21 @@ EX namespace mapstream { for(int i=0; itype; j++) if(c->move(j) && cellids.count(c->move(j)) && cellids[c->move(j)] < i) { int32_t i = cellids[c->move(j)]; f.write(i); f.write_char(c->c.spin(j)); f.write_char(j); + ok = true; break; } + if(!ok) { + println(hlog, "parent not found for ", c, "!"); + for(int j=0; jtype; j++) println(hlog, j, ": ", c->move(j), "; ", int(cellids.count(c->move(j)) ? cellids[c->move(j)] : -1)); + throw hr_exception("parent not found"); + } } f.write_char(c->land); f.write_char(c->mondir);