From df9b3be670b58b2a8183b889b4013bba5875f97d Mon Sep 17 00:00:00 2001 From: RaphaelIT7 Date: Thu, 28 Nov 2024 18:02:31 +0100 Subject: [PATCH] [engine] Fix a downcast issue possibly causing physics bugs This was a bug that was found in gmod & fixed there, if the MAX_MAP_BRUSHSIDES was raised, any brush that had brush sides above the limit would have no collisions. So this would only be a issue if you were to raise it. --- engine/cmodel_private.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/cmodel_private.h b/engine/cmodel_private.h index c9ae33f87..0791b4b97 100644 --- a/engine/cmodel_private.h +++ b/engine/cmodel_private.h @@ -98,13 +98,13 @@ struct cbrushside_t unsigned short bBevel; // is the side a bevel plane? }; -#define NUMSIDES_BOXBRUSH 0xFFFF +#define NUMSIDES_BOXBRUSH -1 struct cbrush_t { int contents; - unsigned short numsides; - unsigned short firstbrushside; + int numsides; + int firstbrushside; inline int GetBox() const { return firstbrushside; } // dimhotepus: int -> unsigned short