From b10dda4a546fdd6f4d99d74d29b5d723e7fa1c64 Mon Sep 17 00:00:00 2001 From: elasota Date: Wed, 25 Dec 2019 22:20:25 -0500 Subject: [PATCH] Fix paper shredder crash --- GpApp/Player.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GpApp/Player.cpp b/GpApp/Player.cpp index 1e9597f..e8f8ad1 100644 --- a/GpApp/Player.cpp +++ b/GpApp/Player.cpp @@ -9,6 +9,7 @@ #include "Play.h" #include "RectUtils.h" +#include #define kGravity 3 #define kHImpulse 2 @@ -1301,6 +1302,10 @@ void MoveGliderShredding (gliderPtr thisGlider) { AddAShreddedGlider(&thisGlider->dest); thisGlider->frame = kShredderCountdown; + + thisGlider->dest.bottom = thisGlider->dest.top; + thisGlider->src.bottom = thisGlider->src.top; + thisGlider->mask.bottom = thisGlider->mask.top; } else { @@ -1309,6 +1314,8 @@ void MoveGliderShredding (gliderPtr thisGlider) thisGlider->mask.bottom = thisGlider->mask.top + vNotClipped; } } + + assert(thisGlider->src.bottom - thisGlider->src.top == thisGlider->dest.bottom - thisGlider->dest.top); } else {