1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Move assertion call behind guard

This commit is contained in:
Bjorn Stromberg 2020-07-23 15:56:44 +09:00
parent aa096e2744
commit 48905aa98d

View File

@ -158,7 +158,9 @@ export class AtlasSprite extends BaseSprite {
const scale = parameters.desiredAtlasScale;
const link = this.linksByResolution[scale];
assert(link, "Link not known: " + scale);
if (!link) {
assert(false, "Link not known: " + scale + " (having " + Object.keys(this.linksByResolution) + ")");
}
const scaleW = w / link.w;
const scaleH = h / link.h;