diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 6e99dee1a8..ff563577c9 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -14,6 +14,7 @@ *****************************************************************************/ #pragma endregion +#include "../../core/Util.hpp" #include "../../interface/viewport.h" #include "../../localisation/localisation.h" #include "../../paint/paint.h" @@ -148,9 +149,12 @@ static void top_spin_paint_vehicle(paint_session * session, sint8 al, sint8 cl, LocationXYZ16 seatCoords = { al, cl, static_cast(height) }; + if (armRotation >= static_cast(Util::CountOf(TopSpinSeatHeightOffset))) + { + return; + } seatCoords.z += TopSpinSeatHeightOffset[armRotation]; - assert(armRotation < static_cast(sizeof(TopSpinSeatPositionOffset))); switch (direction) { case 0: