From 3a41614607977462a314ee2cc3a99d9bd352793b Mon Sep 17 00:00:00 2001 From: Connor Smith Date: Sun, 12 May 2024 03:49:18 +1000 Subject: [PATCH] Fix falsey value bug causing certain tinted objects to display colourless. Fixes #42. --- CHECKLIST.md | 7 +++++++ process/src/SpriteProcessor.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHECKLIST.md b/CHECKLIST.md index 0261d2d48..78e08e321 100644 --- a/CHECKLIST.md +++ b/CHECKLIST.md @@ -54,3 +54,10 @@ This is a list of items and transitions to check to ensure everything is correct * [Hand Cart](https://onetech.info/484-Hand-Cart/recipe): 1 log, wooden disks * [Running Crude Car](https://onetech.info/2396-Running-Crude-Car/recipe): 5 yew branches * [Cistern](https://onetech.info/672-Cistern/recipe): 10 stones + + +### Tinted sprites + +* [Glass Bottle](https://twotech.twohoursonelife.com/3338-Glass-Bottle): it should not be white +* [Floor Blueprint](https://twotech.twohoursonelife.com/14064-Floor-Blueprint): should appear blue +* [Green Linen Top](https://twotech.twohoursonelife.com/14730-Green-Linen-Top): should appear green diff --git a/process/src/SpriteProcessor.js b/process/src/SpriteProcessor.js index a8faad576..ca81698a5 100644 --- a/process/src/SpriteProcessor.js +++ b/process/src/SpriteProcessor.js @@ -119,7 +119,7 @@ class SpriteProcessor { drawSpriteDirectly(sprite, context) { this.drawSpriteImage(sprite, context); - if (sprite.color.find(c => c < 1.0)) { + if (sprite.color.find(c => c < 1.0) !== undefined) { this.overlayColor(sprite, context) } }