diff --git a/qbsp/map.cc b/qbsp/map.cc index b628138b..5cb61160 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -1400,6 +1400,9 @@ static void ParseTextureDef(parser_t &parser, mapface_t &mapface, const mapbrush } else if (!extinfo.info) { extinfo.info = extended_texinfo_t{}; } + + // remove TRANSLUCENT; it's only meant to be set by the compiler + extinfo.info->contents.native &= ~Q2_CONTENTS_TRANSLUCENT; } tx->miptex = FindMiptex(mapface.texname.c_str(), extinfo.info); diff --git a/qbsp/qbsp.cc b/qbsp/qbsp.cc index a6a511d9..a96c4df5 100644 --- a/qbsp/qbsp.cc +++ b/qbsp/qbsp.cc @@ -456,7 +456,14 @@ static void FloodAreas_r(node_t *node) if (node->planenum == PLANENUM_LEAF && node->contents.native == Q2_CONTENTS_AREAPORTAL) { // grab the func_areanode entity mapentity_t *entity = AreanodeEntityForLeaf(node); - Q_assert(entity != nullptr); + + if (entity == nullptr) + { + logging::print("WARNING: areaportal contents in node, but no entity found {} -> {}\n", + node->bounds.mins(), + node->bounds.maxs()); + return; + } // this node is part of an area portal; // if the current area has allready touched this @@ -555,6 +562,13 @@ static void SetAreaPortalAreas_r(node_t *node) // grab the func_areanode entity mapentity_t *entity = AreanodeEntityForLeaf(node); + if (!entity) + { + logging::print("WARNING: areaportal missing for node: {} -> {}\n", + node->bounds.mins(), node->bounds.maxs()); + return; + } + node->area = entity->portalareas[0]; if (!entity->portalareas[1]) { logging::print("WARNING: areaportal entity {} doesn't touch two areas\n Entity Bounds: {} -> {}\n",