修复O块在变形后hold失去名字和颜色属性
This commit is contained in:
@@ -643,7 +643,8 @@ function Player:hold(ifpre)
|
|||||||
local ENV=self.gameEnv
|
local ENV=self.gameEnv
|
||||||
if self.holdTime>0 and(ifpre or self.waiting==-1)then
|
if self.holdTime>0 and(ifpre or self.waiting==-1)then
|
||||||
if #self.holdQueue<ENV.holdCount and self.nextQueue[1]then--Skip
|
if #self.holdQueue<ENV.holdCount and self.nextQueue[1]then--Skip
|
||||||
ins(self.holdQueue,self:getBlock(self.cur.id))
|
local C=self.cur
|
||||||
|
ins(self.holdQueue,self:getBlock(C.id,C.name,C.color))
|
||||||
|
|
||||||
local t=self.holdTime
|
local t=self.holdTime
|
||||||
self:popNext(true)
|
self:popNext(true)
|
||||||
@@ -730,16 +731,16 @@ function Player:hold(ifpre)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Player:getBlock(n)--Get a block(id=n) object
|
function Player:getBlock(id,name,color)--Get a block(id=n) object
|
||||||
local E=self.gameEnv
|
local E=self.gameEnv
|
||||||
local dir=E.face[n]
|
local dir=E.face[id]
|
||||||
return{
|
return{
|
||||||
id=n,
|
id=id,
|
||||||
bk=BLOCKS[n][dir],
|
|
||||||
sc=SCS[n][dir],
|
|
||||||
dir=dir,
|
dir=dir,
|
||||||
name=n,
|
bk=BLOCKS[id][dir],
|
||||||
color=E.bone and 17 or E.skin[n],
|
sc=SCS[id][dir],
|
||||||
|
name=name or id,
|
||||||
|
color=E.bone and 17 or color or E.skin[id],
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
function Player:getNext(n)--Push a block(id=n) to nextQueue
|
function Player:getNext(n)--Push a block(id=n) to nextQueue
|
||||||
|
|||||||
Reference in New Issue
Block a user