From 4037cdf86bd7ad2f17017b88083a055cbbabe2cc Mon Sep 17 00:00:00 2001 From: "Timothy.Stiles" Date: Wed, 3 Mar 2021 13:04:55 +1100 Subject: [PATCH] don't crash in _draw_standard if p < 0 (fixes #58) --- js/tileset.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/tileset.js b/js/tileset.js index a152967..a7baeba 100644 --- a/js/tileset.js +++ b/js/tileset.js @@ -1185,6 +1185,10 @@ export class Tileset { // Lexy runs cooldown from S to 1; CC2 from S-1 to 0. 0 is bad, because p becomes 1 // and will overflow the cel lookup // FIXME handle this better! it happens even to lexy + // this new one happened because of turntable attempt_step, not sure why yet + if (p < 0) { + p = 0; + } if (p >= 1) { p = 0.999; }