From 47df33f928839e1900d674c79e955dc4074f2a06 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Mon, 6 Nov 2023 19:45:03 +0700 Subject: [PATCH] - [VFX trail] Fix crash when reading negative path position. --- scripts/node_VFX_trail_path/node_VFX_trail_path.gml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/node_VFX_trail_path/node_VFX_trail_path.gml b/scripts/node_VFX_trail_path/node_VFX_trail_path.gml index 7380539ae..518f4e1e8 100644 --- a/scripts/node_VFX_trail_path/node_VFX_trail_path.gml +++ b/scripts/node_VFX_trail_path/node_VFX_trail_path.gml @@ -47,8 +47,9 @@ function Node_VFX_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) construct var line = lines[_ind]; var _st = _rat * (lineLength[_ind] - 1); - _p0 = line[floor(_st) + 0]; - _p1 = line[floor(_st) + 1]; + + _p0 = line[clamp(floor(_st) + 0, 0, array_length(line) - 1)]; + _p1 = line[clamp(floor(_st) + 1, 0, array_length(line) - 1)]; if(!is_array(_p0)) return out; if(!is_array(_p1)) return out;