diff --git a/common/bspfile.cc b/common/bspfile.cc index 1e6a76ed..fcb3beb2 100644 --- a/common/bspfile.cc +++ b/common/bspfile.cc @@ -80,6 +80,8 @@ struct gamedef_generic_t : public gamedef_t bool portal_can_see_through(const contentflags_t &, const contentflags_t &) const { throw std::bad_cast(); } + bool contents_seals_map(const contentflags_t &contents) const { throw std::bad_cast(); } + std::string get_contents_display(const contentflags_t &) const { throw std::bad_cast(); } const std::initializer_list &get_hull_sizes() const { throw std::bad_cast(); } @@ -252,6 +254,11 @@ struct gamedef_q1_like_t : public gamedef_t return !(contents0.is_solid(this) || contents1.is_solid(this)) && contents0 == contents1; } + bool contents_seals_map(const contentflags_t &contents) const override + { + return contents_are_solid(contents) || contents_are_sky(contents); + } + std::string get_contents_display(const contentflags_t &contents) const { switch (contents.native) { @@ -587,6 +594,11 @@ struct gamedef_q2_t : public gamedef_t return visible_contents(c0 ^ c1); } + bool contents_seals_map(const contentflags_t& contents) const override + { + return contents_are_solid(contents) || contents_are_sky(contents); + } + std::string get_contents_display(const contentflags_t &contents) const { constexpr const char *bitflag_names[] = {"SOLID", "WINDOW", "AUX", "LAVA", "SLIME", "WATER", "MIST", "128", diff --git a/include/common/bspfile.hh b/include/common/bspfile.hh index dbd8c4de..ef95d04f 100644 --- a/include/common/bspfile.hh +++ b/include/common/bspfile.hh @@ -1781,6 +1781,7 @@ struct gamedef_t virtual bool contents_are_liquid(const contentflags_t &contents) const = 0; virtual bool contents_are_valid(const contentflags_t &contents, bool strict = true) const = 0; virtual bool portal_can_see_through(const contentflags_t &contents0, const contentflags_t &contents1) const = 0; + virtual bool contents_seals_map(const contentflags_t &contents) const = 0; virtual std::string get_contents_display(const contentflags_t &contents) const = 0; virtual const std::initializer_list &get_hull_sizes() const = 0; virtual contentflags_t face_get_contents(