add early return in freshBlockGhost
This commit is contained in:
@@ -948,35 +948,34 @@ function Player:changeAtk(R)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:freshBlockGhost()
|
function Player:freshBlockGhost()
|
||||||
|
if not self.cur then return end
|
||||||
local ENV=self.gameEnv
|
local ENV=self.gameEnv
|
||||||
if self.cur then
|
local CB=self.cur.bk
|
||||||
local CB=self.cur.bk
|
self.ghoY=min(#self.field+1,self.curY)
|
||||||
self.ghoY=min(#self.field+1,self.curY)
|
if self._20G or ENV.sdarr==0 and self.keyPressing[7] and self.downing>=ENV.sddas then
|
||||||
if self._20G or ENV.sdarr==0 and self.keyPressing[7] and self.downing>=ENV.sddas then
|
local _=self.ghoY
|
||||||
local _=self.ghoY
|
|
||||||
|
|
||||||
-- Move ghost to bottom
|
-- Move ghost to bottom
|
||||||
while not self:ifoverlap(CB,self.curX,self.ghoY-1) do
|
while not self:ifoverlap(CB,self.curX,self.ghoY-1) do
|
||||||
self.ghoY=self.ghoY-1
|
self.ghoY=self.ghoY-1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Cancel spinLast
|
-- Cancel spinLast
|
||||||
if _~=self.ghoY then
|
if _~=self.ghoY then
|
||||||
self.spinLast=false
|
self.spinLast=false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create FX if dropped
|
-- Create FX if dropped
|
||||||
if self.curY>self.ghoY then
|
if self.curY>self.ghoY then
|
||||||
self:createDropFX()
|
self:createDropFX()
|
||||||
if ENV.shakeFX then
|
if ENV.shakeFX then
|
||||||
self.swingOffset.vy=.5
|
self.swingOffset.vy=.5
|
||||||
end
|
|
||||||
self.curY=self.ghoY
|
|
||||||
end
|
|
||||||
else
|
|
||||||
while not self:ifoverlap(CB,self.curX,self.ghoY-1) do
|
|
||||||
self.ghoY=self.ghoY-1
|
|
||||||
end
|
end
|
||||||
|
self.curY=self.ghoY
|
||||||
|
end
|
||||||
|
else
|
||||||
|
while not self:ifoverlap(CB,self.curX,self.ghoY-1) do
|
||||||
|
self.ghoY=self.ghoY-1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user