From d436af8352176ab7a22fc09c937b2d5c9ae219dd Mon Sep 17 00:00:00 2001 From: Russell Date: Mon, 16 Oct 2023 17:12:50 +0100 Subject: [PATCH] Fix bug https://github.com/YoYoGames/GameMaker-Bugs/issues/1709 * ensure that a struct returned from json_parse is reported as a struct * fix potential bug in lerp that Ash noticed. --- scripts/functions/Function_File.js | 2 +- scripts/functions/Function_Maths.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/functions/Function_File.js b/scripts/functions/Function_File.js index acf0150c..fcab4e07 100644 --- a/scripts/functions/Function_File.js +++ b/scripts/functions/Function_File.js @@ -1404,7 +1404,7 @@ function _json_reviver(_, value) } // It's an object prepare to set internal values var obj = {}; - obj.__type = "Object"; + obj.__type = "___struct___"; obj.__yyIsGMLObject = true; // Go through all the property names in parsed value for (var oName in value) { diff --git a/scripts/functions/Function_Maths.js b/scripts/functions/Function_Maths.js index 6b391586..0421dfa6 100644 --- a/scripts/functions/Function_Maths.js +++ b/scripts/functions/Function_Maths.js @@ -1535,7 +1535,7 @@ function lerp(_val1, _val2, _amount) { _val1 = yyGetReal(_val1); _val2 = yyGetReal(_val2); - return _val1 + ((_val2 - _val1) * _amount); + return _val1 + ((_val2 - _val1) * yyGetReal(_amount)); }