Skip to content

Commit

Permalink
Fixed bug with missing block position
Browse files Browse the repository at this point in the history
  • Loading branch information
RexScratch committed Jun 20, 2021
1 parent 234e8c5 commit 8884324
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions sb3tosb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,12 +1648,15 @@ def convertTarget(self, target, index, maxLen):

if type(b) == list:

x = round(b[3] / 1.5, 6)
if x % 1 == 0:
x = int(x)
y = round(b[4] / 1.8, 6)
if y % 1 == 0:
y = int(y)
try:
x = round(b[3] / 1.5, 6)
if x % 1 == 0:
x = int(x)
y = round(b[4] / 1.8, 6)
if y % 1 == 0:
y = int(y)
except Exception as ex:
x, y = 0, 0
script = [x, y]

if b[0] == 12:
Expand All @@ -1669,12 +1672,15 @@ def convertTarget(self, target, index, maxLen):

elif b['topLevel']:

x = round(b['x'] / 1.5, 6)
if x % 1 == 0:
x = int(x)
y = round(b['y'] / 1.8, 6)
if y % 1 == 0:
y = int(y)
try:
x = round(b['x'] / 1.5, 6)
if x % 1 == 0:
x = int(x)
y = round(b['y'] / 1.8, 6)
if y % 1 == 0:
y = int(y)
except Exception as ex:
x, y = 0, 0

self.compatStackReporters = []
substack = self.convertSubstack(key, blocks)
Expand Down

0 comments on commit 8884324

Please sign in to comment.