qbsp: fix external maps with no worldspawn brushes
Thanks to ZungryWare for the report
This commit is contained in:
parent
cefd20c8da
commit
5e74b4d0bb
|
|
@ -73,7 +73,11 @@ public:
|
||||||
brushformat_t format;
|
brushformat_t format;
|
||||||
int contents;
|
int contents;
|
||||||
|
|
||||||
mapbrush_t() : firstface(0), numfaces(0), format(brushformat_t::NORMAL) {}
|
mapbrush_t() :
|
||||||
|
firstface(0),
|
||||||
|
numfaces(0),
|
||||||
|
format(brushformat_t::NORMAL),
|
||||||
|
contents(0) {}
|
||||||
const mapface_t &face(int i) const;
|
const mapface_t &face(int i) const;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1900,8 +1900,15 @@ mapentity_t LoadExternalMap(const char *filename)
|
||||||
while (ParseEntity(&parser, &dummy)) {
|
while (ParseEntity(&parser, &dummy)) {
|
||||||
// this is kind of fragile, but move the brushes to the worldspawn.
|
// this is kind of fragile, but move the brushes to the worldspawn.
|
||||||
if (dummy.nummapbrushes) {
|
if (dummy.nummapbrushes) {
|
||||||
|
// special case for when the external map's worldspawn has no brushes
|
||||||
|
if (!dest.firstmapbrush) {
|
||||||
|
dest.firstmapbrush = dummy.firstmapbrush;
|
||||||
|
}
|
||||||
dest.nummapbrushes += dummy.nummapbrushes;
|
dest.nummapbrushes += dummy.nummapbrushes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear for the next loop iteration
|
||||||
|
dummy = mapentity_t();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dest.nummapbrushes) {
|
if (!dest.nummapbrushes) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue