From f0e2f4ba96b4caa6d404537d60b0061672dd0f12 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Fri, 5 Feb 2021 22:26:13 -0700 Subject: [PATCH] common: small tweaks: CopyWinding accepts null, document face side --- common/polylib.cc | 4 ++++ include/common/bspfile.hh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/polylib.cc b/common/polylib.cc index 409237f6..6397b310 100644 --- a/common/polylib.cc +++ b/common/polylib.cc @@ -223,6 +223,10 @@ polylib::BaseWindingForPlane(const vec3_t normal, const float dist) polylib::winding_t * polylib::CopyWinding(const winding_t * w) { + if (w == nullptr) { + return nullptr; + } + int size; winding_t *c; diff --git a/include/common/bspfile.hh b/include/common/bspfile.hh index e7dad3f1..01bd23c6 100644 --- a/include/common/bspfile.hh +++ b/include/common/bspfile.hh @@ -402,7 +402,7 @@ typedef struct { typedef struct { int32_t planenum; - int32_t side; + int32_t side; // if true, the face is on the back side of the plane int32_t firstedge; /* we must support > 64k edges */ int32_t numedges; int32_t texinfo;