diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-07-14 00:21:53 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-07-14 00:21:53 +0800 |
commit | a503e9dd2fb936cf94ab79546161401db06acc40 (patch) | |
tree | 1f0a2b327980fe6d514ab64aaad60859ef4a1765 /features/dungeonMap/index.js | |
parent | bc123d74472c7d8745eb9ca2287b7fcd1f08f35e (diff) | |
download | SoopyV2-a503e9dd2fb936cf94ab79546161401db06acc40.tar.gz SoopyV2-a503e9dd2fb936cf94ab79546161401db06acc40.tar.bz2 SoopyV2-a503e9dd2fb936cf94ab79546161401db06acc40.zip |
+ maby fix crash for some people
Diffstat (limited to 'features/dungeonMap/index.js')
-rw-r--r-- | features/dungeonMap/index.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js index ddfb534..68adf7e 100644 --- a/features/dungeonMap/index.js +++ b/features/dungeonMap/index.js @@ -861,11 +861,21 @@ class DungeonMap extends Feature { let renderX = Math.round((parseInt(x) + 16) / this.mapScale + this.offset[0]) // / 128 * size let renderY = Math.round((parseInt(y) + 16) / this.mapScale + this.offset[1])// / 128 * size - - if (bytes[renderX + renderY * 128] === 30) { - let [first, second] = ent[1].split(" ") - ent[1] = "&a" + second + " " + second + // console.log(renderX, renderY) + let isGreen = false + for (let i = 0; i < 10; i++) { + if (bytes[renderX + i + (renderY + i) * 128] === 30 + || bytes[renderX + i + 1 + (renderY + i) * 128] === 30) { + isGreen = true + } + } + console.log(ent[1], isGreen) + if (isGreen) { + let total = ent[1].split(" ")[1] + ent[1] = "&a" + total + " " + total + console.log(ent[1]) } + console.log(ent[1], isGreen) } } // if (!this.renderImage) return |