Fixed a corner case in the last commit

This commit is contained in:
Ishaan Bhardwaj 2021-03-06 22:13:38 -05:00
parent 1f0b43f1b7
commit 2ea75cdfaf

View File

@ -534,11 +534,18 @@ function GameMode:initializeNextPiece(inputs, ruleset, piece_data, generate_next
end
if self.buffer_hard_drop then
self.buffer_hard_drop = false
local above_field = (
(config.gamesettings.spawn_positions == 1 and
ruleset.spawn_above_field) or
config.gamesettings.spawn_positions == 3
)
self:onHardDrop(self.piece.position.y - (
self.piece.big and
ruleset.big_spawn_positions[self.piece.shape].y or
ruleset.spawn_positions[self.piece.shape].y) +
ruleset:getAboveFieldOffset(piece_data.shape, piece_data.orientation)
(above_field and ruleset:getAboveFieldOffset(
piece_data.shape, piece_data.orientation
) or 0)
)
end
if self.buffer_soft_drop then