misc_external_map: fix -onlyents
This commit is contained in:
parent
ce8ad6c384
commit
73ffb37417
|
|
@ -1616,6 +1616,8 @@ static void TranslateMapFace(mapface_t *face, const vec3_t offset)
|
|||
void
|
||||
ProcessExternalMapEntity(mapentity_t *entity)
|
||||
{
|
||||
Q_assert(!options.fOnlyents);
|
||||
|
||||
const char *classname = ValueForKey(entity, "classname");
|
||||
if (Q_strcasecmp(classname, "misc_external_map"))
|
||||
return;
|
||||
|
|
@ -1626,6 +1628,8 @@ ProcessExternalMapEntity(mapentity_t *entity)
|
|||
Q_assert(file && file[0]);
|
||||
Q_assert(new_classname && new_classname[0]);
|
||||
|
||||
Q_assert(0 == entity->nummapbrushes); // misc_external_map must be a point entity
|
||||
|
||||
const mapentity_t external_worldspawn = LoadExternalMap(file);
|
||||
|
||||
// copy the brushes into the target
|
||||
|
|
|
|||
23
qbsp/qbsp.cc
23
qbsp/qbsp.cc
|
|
@ -251,11 +251,26 @@ UpdateEntLump(void)
|
|||
modnum = 1;
|
||||
for (i = 1; i < map.numentities(); i++) {
|
||||
entity = &map.entities.at(i);
|
||||
if (!entity->nummapbrushes)
|
||||
continue;
|
||||
|
||||
/* Load external .map and change the classname, if needed */
|
||||
ProcessExternalMapEntity(entity);
|
||||
/* Special handling for misc_external_map.
|
||||
Duplicates some logic from ProcessExternalMapEntity. */
|
||||
qboolean is_misc_external_map = false;
|
||||
if (!Q_strcasecmp(ValueForKey(entity, "classname"), "misc_external_map")) {
|
||||
const char *new_classname = ValueForKey(entity, "_external_map_classname");
|
||||
|
||||
SetKeyValue(entity, "classname", new_classname);
|
||||
SetKeyValue(entity, "origin", "0 0 0");
|
||||
|
||||
/* Note: the classname could have switched to
|
||||
* a IsWorldBrushEntity entity (func_group, func_detail),
|
||||
* or a bmodel entity (func_wall
|
||||
*/
|
||||
is_misc_external_map = true;
|
||||
}
|
||||
|
||||
qboolean isBrushEnt = (entity->nummapbrushes > 0) || is_misc_external_map;
|
||||
if (!isBrushEnt)
|
||||
continue;
|
||||
|
||||
if (IsWorldBrushEntity(entity))
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue