qbsp: external map: merge all brush entities with worldspawn

This commit is contained in:
Eric Wasylishen 2017-07-07 20:26:27 -06:00
parent 60cff88335
commit 7656d5c2f1
2 changed files with 10 additions and 5 deletions

View File

@ -133,8 +133,10 @@ to the "origin" key of the "misc_external_map" entity. Finally, the classname of
key. (The "origin" key is also cleared to "0 0 0" before saving the .bsp).
.PP
The external .map file should consist of worldspawn brushes only. All worldspawn keys,
and any entities aside from worldspawn in the external map are ignored.
The external .map file should consist of worldspawn brushes only, although
you can use func_group for editing convenience. Brush entities are merged
with the worldspawn brushes during import. All worldspawn keys, and any point
entities are ignored.
Currently, this means that the "wad" key is not handled, so you need to add
any texture wads required by the external .map file to your main map.

View File

@ -1704,10 +1704,13 @@ mapentity_t LoadExternalMap(const char *filename)
Error("LoadExternalMap: '%s': Expected first entity to be worldspawn, got: '%s'\n", filename, classname);
}
// parse the next entity, warn if there was one
// parse any subsequent entities, move any brushes to worldspawn
mapentity_t dummy {};
if (ParseEntity(&parser, &dummy)) {
Message(msgStat, "LoadExternalMap: '%s': Ignoring entities after the worldspawn\n", filename);
while (ParseEntity(&parser, &dummy)) {
// this is kind of fragile, but move the brushes to the worldspawn.
if (dummy.nummapbrushes) {
dest.nummapbrushes += dummy.nummapbrushes;
}
}
if (!dest.nummapbrushes) {