1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-13 10:11:50 +00:00

Make wired pins component optional on the storage

This commit is contained in:
tobspr 2022-01-22 18:23:05 +01:00
parent 48adc30a87
commit 0540a010a6

View File

@ -50,8 +50,13 @@ export class StorageSystem extends GameSystemWithFilter {
let targetAlpha = storageComp.storedCount > 0 ? 1 : 0;
storageComp.overlayOpacity = lerp(storageComp.overlayOpacity, targetAlpha, 0.05);
pinsComp.slots[0].value = storageComp.storedItem;
pinsComp.slots[1].value = storageComp.getIsFull() ? BOOL_TRUE_SINGLETON : BOOL_FALSE_SINGLETON;
// a wired pins component is not guaranteed, but if its there, set the value
if (pinsComp) {
pinsComp.slots[0].value = storageComp.storedItem;
pinsComp.slots[1].value = storageComp.getIsFull()
? BOOL_TRUE_SINGLETON
: BOOL_FALSE_SINGLETON;
}
}
}