add antartica exception also to pixels drawn by chunk coords
This commit is contained in:
parent
adb558bb52
commit
749a5829a4
|
@ -45,10 +45,10 @@ export async function drawByOffsets(
|
||||||
let coolDown = 0;
|
let coolDown = 0;
|
||||||
let retCode = 0;
|
let retCode = 0;
|
||||||
let pxlCnt = 0;
|
let pxlCnt = 0;
|
||||||
|
let rankedPxlCnt = 0;
|
||||||
const canvas = canvases[canvasId];
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const canvas = canvases[canvasId];
|
||||||
if (!canvas) {
|
if (!canvas) {
|
||||||
// canvas doesn't exist
|
// canvas doesn't exist
|
||||||
throw new Error(1);
|
throw new Error(1);
|
||||||
|
@ -104,10 +104,6 @@ export async function drawByOffsets(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* TODO benchmark if requesting by pixel or chunk is better
|
|
||||||
*/
|
|
||||||
|
|
||||||
while (pixels.length) {
|
while (pixels.length) {
|
||||||
const [offset, color] = pixels.pop();
|
const [offset, color] = pixels.pop();
|
||||||
|
|
||||||
|
@ -171,7 +167,13 @@ export async function drawByOffsets(
|
||||||
}
|
}
|
||||||
|
|
||||||
setPixelByOffset(canvasId, color, i, j, offset);
|
setPixelByOffset(canvasId, color, i, j, offset);
|
||||||
|
|
||||||
pxlCnt += 1;
|
pxlCnt += 1;
|
||||||
|
/* hardcode to not count pixels in antarctica */
|
||||||
|
// eslint-disable-next-line eqeqeq
|
||||||
|
if (canvas.ranked && (canvasId != 0 || y < 14450)) {
|
||||||
|
rankedPxlCnt += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
retCode = parseInt(e.message, 10);
|
retCode = parseInt(e.message, 10);
|
||||||
|
@ -182,8 +184,8 @@ export async function drawByOffsets(
|
||||||
|
|
||||||
if (pxlCnt) {
|
if (pxlCnt) {
|
||||||
user.setWait(wait, canvasId);
|
user.setWait(wait, canvasId);
|
||||||
if (canvas.ranked) {
|
if (rankedPxlCnt) {
|
||||||
user.incrementPixelcount(pxlCnt);
|
user.incrementPixelcount(rankedPxlCnt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user