File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -205,13 +205,13 @@ public override void Update() {
205
205
base . Update ( ) ;
206
206
207
207
// make sure the two blocks don't escape their boundaries when the door opens up.
208
- if ( TopSolid . Top != Y - height ) {
208
+ if ( TopSolid . Top != Y - height && Opened ) {
209
209
// if the top block is at 12 instead of 16, and has height 30, make it height 26 instead.
210
210
float displacement = ( Y - height ) - TopSolid . Top ; // 20 - 16 = 4
211
211
TopSolid . Collider . Height = height - displacement ; // 30 - 4 = 26
212
212
TopSolid . Top = Y - height ; // replace the block at 16
213
213
}
214
- if ( BottomSolid . Bottom != Y + height ) {
214
+ if ( BottomSolid . Bottom != Y + height && Opened ) {
215
215
float displacement = BottomSolid . Top - Y ;
216
216
BottomSolid . Collider . Height = height - displacement ;
217
217
}
You can’t perform that action at this time.
0 commit comments