X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fwinding.cpp;h=8865db52aff206f4a0050d90eac9608c90b64f7d;hb=cc23ea85efbc4070d4516385143a2bfb5747cc30;hp=9651af2c2c027dc665fbda6d9f91dfa7ddb721ec;hpb=62d99f889c0e98be65f779d3983109c84ce58cec;p=xonotic%2Fnetradiant.git diff --git a/radiant/winding.cpp b/radiant/winding.cpp index 9651af2c..8865db52 100644 --- a/radiant/winding.cpp +++ b/radiant/winding.cpp @@ -194,6 +194,10 @@ const double DEBUG_EPSILON_SQUARED = DEBUG_EPSILON * DEBUG_EPSILON; /// If \p winding is completely in back of the plane, \p clipped will be empty. /// If \p winding intersects the plane, the edge of \p clipped which lies on \p clipPlane will store the value of \p adjacent. void Winding_Clip( const FixedWinding& winding, const Plane3& plane, const Plane3& clipPlane, std::size_t adjacent, FixedWinding& clipped ){ + // if there are no points, we're done + if ( winding.size() == 0 ) { + return; + } PlaneClassification classification = Winding_ClassifyDistance( plane3_distance_to_point( clipPlane, winding.back().vertex ), ON_EPSILON ); PlaneClassification nextClassification; // for each edge