From 5902fcebd76a91527193c9a2bf24fa8ba592d58c Mon Sep 17 00:00:00 2001 From: glx22 Date: Sat, 1 Mar 2025 22:02:20 +0100 Subject: [PATCH] Fix: [Script] "type" std function might be redefined by scripts --- bin/ai/compat_14.nut | 2 +- bin/game/compat_14.nut | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ai/compat_14.nut b/bin/ai/compat_14.nut index 8632f8523b..012a8d070c 100644 --- a/bin/ai/compat_14.nut +++ b/bin/ai/compat_14.nut @@ -12,7 +12,7 @@ AIBridge.GetBridgeID <- AIBridge.GetBridgeType; class AICompat14 { function Text(text) { - if (type(text) == "string") return text; + if (typeof text == "string") return text; return null; } } diff --git a/bin/game/compat_14.nut b/bin/game/compat_14.nut index d9849572c9..00efae0b65 100644 --- a/bin/game/compat_14.nut +++ b/bin/game/compat_14.nut @@ -12,8 +12,8 @@ GSBridge.GetBridgeID <- GSBridge.GetBridgeType; class GSCompat14 { function Text(text) { - if (type(text) == "string") return text; - if (type(text) == "instance" && text instanceof GSText) return text; + if (typeof text == "string") return text; + if (typeof text == "instance" && text instanceof GSText) return text; return null; } }