warning for incorrect decrypt size

This commit is contained in:
Soph :3 2024-05-03 00:52:41 +03:00
parent 2c6835e2b3
commit b5e4cabe4d
Signed by: sophie
GPG key ID: EDA5D222A0C270F2
2 changed files with 4 additions and 0 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -99,6 +99,10 @@ export class World {
this.data = ungziped.slice(cborSize+4); this.data = ungziped.slice(cborSize+4);
this.dataView = new DataView(this.data.buffer); this.dataView = new DataView(this.data.buffer);
if(4 + this.size.x * this.size.y * this.size.z == this.data.length) {
console.log('[WARNING] Encoding was wrong somewhere!')
}
} catch(e) { } catch(e) {
const layers = Math.floor(this.size.y / 2); const layers = Math.floor(this.size.y / 2);