Fix for engines that require edges reference valid vertices (edge 0 references vertex 0 but it might not be set in some cases)
Change `Brush_GetContents` again so that clip works
This commit is contained in:
parent
686cdf4217
commit
0392698bd3
|
|
@ -668,14 +668,13 @@ static contentflags_t Brush_GetContents(const mapbrush_t *mapbrush)
|
|||
for (int i = 0; i < mapbrush->numfaces; i++) {
|
||||
const mapface_t &mapface = mapbrush->face(i);
|
||||
const mtexinfo_t &texinfo = map.mtexinfos.at(mapface.texinfo);
|
||||
contentflags_t contents = options.target_game->face_get_contents(mapface.texname.data(), texinfo.flags, mapface.contents);
|
||||
|
||||
if (texinfo.flags.is_skip) {
|
||||
if (contents.is_empty(options.target_game)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
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
|
||||
// use the first non-empty as the base contents value
|
||||
if (!base_contents_set) {
|
||||
base_contents_set = true;
|
||||
base_contents = contents;
|
||||
|
|
|
|||
|
|
@ -439,6 +439,12 @@ void FinishBSPFile(void)
|
|||
options.fVerbose = true;
|
||||
LogPrint(LOG_PROGRESS, "---- {} ----\n", __func__);
|
||||
|
||||
if (map.bsp.dvertexes.empty()) {
|
||||
// First vertex must remain unused because edge references it
|
||||
map.bsp.dvertexes.emplace_back();
|
||||
Q_assert(map.bsp.dvertexes.size() == 1);
|
||||
}
|
||||
|
||||
WriteExtendedTexinfoFlags();
|
||||
WriteBSPFile();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue