diff --git a/common/bspfile.cc b/common/bspfile.cc index dcf3d691..03001449 100644 --- a/common/bspfile.cc +++ b/common/bspfile.cc @@ -271,7 +271,7 @@ struct gamedef_q1_like_t : public gamedef_t // check for strong content indicators if (!Q_strcasecmp(texname.data(), "origin")) { return create_extended_contents(CFLAGS_ORIGIN); - } else if (!Q_strcasecmp(texname.data(), "hint")) { + } else if (!Q_strcasecmp(texname.data(), "hint") || !Q_strcasecmp(texname.data(), "hintskip")) { return create_extended_contents(CFLAGS_HINT); } else if (!Q_strcasecmp(texname.data(), "clip")) { return create_extended_contents(CFLAGS_CLIP); diff --git a/include/qbsp/qbsp.hh b/include/qbsp/qbsp.hh index 6cc54141..6bfacb3b 100644 --- a/include/qbsp/qbsp.hh +++ b/include/qbsp/qbsp.hh @@ -264,7 +264,7 @@ struct surface_t bounds += f->w.bounds(); - Q_assert(!qv::emptyExact(bounds.size())); + //Q_assert(!qv::emptyExact(bounds.size())); } } }; diff --git a/qbsp/brush.cc b/qbsp/brush.cc index 1dc771b3..5cbe00fc 100644 --- a/qbsp/brush.cc +++ b/qbsp/brush.cc @@ -675,14 +675,8 @@ static void ExpandBrush(hullbrush_t *hullbrush, const aabb3d &hull_size, std::ve static contentflags_t Brush_GetContents(const mapbrush_t *mapbrush) { - // use the first side as the base contents value - contentflags_t base_contents; - - { - const mapface_t &mapface = mapbrush->face(0); - const mtexinfo_t &texinfo = map.mtexinfos.at(mapface.texinfo); - base_contents = options.target_game->face_get_contents(mapface.texname.data(), texinfo.flags, mapface.contents); - } + bool base_contents_set = false; + contentflags_t base_contents = options.target_game->create_empty_contents(); // validate that all of the sides have valid contents for (int i = 0; i < mapbrush->numfaces; i++) { @@ -694,6 +688,12 @@ static contentflags_t Brush_GetContents(const mapbrush_t *mapbrush) } contentflags_t contents = options.target_game->face_get_contents(mapface.texname.data(), texinfo.flags, mapface.contents); + + // use the first non-skip as the base contents value + if (!base_contents_set) { + base_contents_set = true; + base_contents = contents; + } if (!contents.types_equal(base_contents, options.target_game)) { LogPrint("mixed face contents ({} != {}) at line {}\n", diff --git a/qbsp/map.cc b/qbsp/map.cc index 288c882e..5104bae9 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -1827,7 +1827,7 @@ mapentity_t LoadExternalMap(const char *filename) auto file = fs::load(filename); if (!file) { - FError("Couldn't load external map file \"{}.\"\n", filename); + FError("Couldn't load external map file \"{}\".\n", filename); } parser_t parser(file->data(), file->size()); @@ -2147,11 +2147,11 @@ void WriteEntitiesToString() for (auto &ep : entity.epairs) { if (ep.first.size() >= options.target_game->max_entity_key - 1) { - LogPrint("WARNING: {} at {} (approx. line {}) has long key {} (length {} >= {})\n", ValueForKey(&entity, "classname"), entity.origin, entity.mapbrush(0).face(0).linenum, ep.first, ep.first.size(), options.target_game->max_entity_key - 1); + LogPrint("WARNING: {} at {} has long key {} (length {} >= {})\n", ValueForKey(&entity, "classname"), entity.origin, ep.first, ep.first.size(), options.target_game->max_entity_key - 1); } if (ep.second.size() >= options.target_game->max_entity_value - 1) { - LogPrint("WARNING: {} at {} (approx. line {}) has long value for key {} (length {} >= {})\n", ValueForKey(&entity, "classname"), entity.origin, entity.mapbrush(0).face(0).linenum, ep.first, ep.second.size(), options.target_game->max_entity_value - 1); + LogPrint("WARNING: {} at {} has long value for key {} (length {} >= {})\n", ValueForKey(&entity, "classname"), entity.origin, ep.first, ep.second.size(), options.target_game->max_entity_value - 1); } fmt::format_to(std::back_inserter(map.bsp.dentdata), "\"{}\" \"{}\"\n", ep.first, ep.second);