diff --git a/source/core/maploader.cpp b/source/core/maploader.cpp index 9dc4e8435..e5ae9f271 100644 --- a/source/core/maploader.cpp +++ b/source/core/maploader.cpp @@ -522,13 +522,20 @@ void loadMapBackup(const char* filename) void setWallSectors() { int i = 0; + for (auto& wal : walls()) + { + wal.sector = -1; + } for(auto& sect : sectors()) { sect.dirty = 255; sect.exflags = 0; for (auto& wal : wallsofsector(§)) { - wal.sector = i; + if (wal.sector == -1) + wal.sector = i; + else + Printf("Wall %d referenced by multiple sectors (%d, %d)!\n", wallnum(&wal), wal.sector, sectnum(§)); } i++; }