Skip to content

Commit

Permalink
set ghost Y when trying to hang with the current piece (#1066)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImpleLee authored Dec 20, 2023
1 parent ad0b73f commit 11680ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parts/player/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,7 @@ function Player:hold_norm(ifpre)
ins(self.holdQueue,self:_getBlock(C.id,C.name,C.color))

if self:willDieWith(self.nextQueue[1]) then
self.ghoY=self:getSpawnY(self.nextQueue[1])
self.cur=nil
self.waiting=ENV.hang
self.holdIXSFromNext={ifpre}
Expand Down Expand Up @@ -1313,6 +1314,7 @@ function Player:hold_norm(ifpre)
if C then
ins(self.holdQueue,self:_getBlock(C.id,C.name,C.color))
if self:willDieWith(self.holdQueue[1]) then
self.ghoY=self:getSpawnY(self.holdQueue[1])
self.cur=nil
self.waiting=ENV.hang
return
Expand Down Expand Up @@ -1368,6 +1370,7 @@ function Player:hold_swap(ifpre)
ins(self.holdQueue,self.nextQueue[hid])
self.nextQueue[hid]=hb
if self:willDieWith(self.holdQueue[1]) then
self.ghoY=self:getSpawnY(self.holdQueue[1])
self.cur=nil
self.waiting=ENV.hang
return
Expand Down Expand Up @@ -2072,6 +2075,7 @@ do
-- Prevent sudden death if hang>0
if ENV.hang>ENV.wait then
if self:willDieWith(self.nextQueue[1]) then
self.ghoY=self:getSpawnY(self.nextQueue[1])
self.waiting=self.waiting+ENV.hang
end
end
Expand Down

0 comments on commit 11680ae

Please sign in to comment.