1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-18 20:19:11 +00:00

Revert d7bd67cda3: [Scripts] "_typeof" metamethod negatively affects old scripts

This commit is contained in:
glx22
2025-02-19 14:58:24 +01:00
committed by Loïc Guilloux
parent 3d5083218d
commit a577229e95
7 changed files with 8 additions and 13 deletions

View File

@@ -12,8 +12,8 @@ AIBridge.GetBridgeID <- AIBridge.GetBridgeType;
class AICompat14 {
function Text(text)
{
if (typeof(text) != "string") return null;
return text;
if (type(text) == "string") return text;
return null;
}
}

View File

@@ -12,9 +12,9 @@ GSBridge.GetBridgeID <- GSBridge.GetBridgeType;
class GSCompat14 {
function Text(text)
{
type = typeof(text)
if (type != "string" && type != "GSText") return null;
return text;
if (type(text) == "string") return text;
if (type(text) == "instance" && text instanceof GSText) return text;
return null;
}
}