Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix swap bagline #970

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parts/player/draw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ local function _drawNext(P,repMode)
if ENV.bagLine then
gc_setColor(.8,.8,.8,.8)
for i=1,ENV.nextCount+1 do
if queue[i] and queue[i].bagLine>0 then
if queue[i] and queue[i].bagLine and queue[i].bagLine>0 then
gc_rectangle('fill',1,72*(i-1)+3,98,2)
end
end
Expand Down
3 changes: 3 additions & 0 deletions parts/player/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,7 @@ function Player:hold_swap(ifpre)
hb.name=C.name
hb.color=C.color
self.cur,self.nextQueue[hid]=self.nextQueue[hid],hb
self.cur.bagLine=nil

self.curX,self.curY=x,y
else-- Normal hold
Expand All @@ -1384,6 +1385,7 @@ function Player:hold_swap(ifpre)
hb.color=C.color
hb.name=C.name
self.cur,self.nextQueue[hid]=self.nextQueue[hid],hb
self.cur.bagLine=nil

self:resetBlock()
end
Expand Down Expand Up @@ -1444,6 +1446,7 @@ function Player:popNext(ifhold)-- Pop nextQueue to hand

if self.nextQueue[1] then
self.cur=rem(self.nextQueue,1)
self.cur.bagLine=nil
self:newNext()
self.pieceCount=self.pieceCount+1

Expand Down