From 256096841a019faec854107382f3b5f0f540ac30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 3 Nov 2024 19:43:16 +0200 Subject: [PATCH] Work-around for maps that have \x1B instead of comma for output args --- entities/entities/lambda_entity.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/entities/entities/lambda_entity.lua b/entities/entities/lambda_entity.lua index 179323df..10e6680e 100644 --- a/entities/entities/lambda_entity.lua +++ b/entities/entities/lambda_entity.lua @@ -302,6 +302,15 @@ function ENT:SetInputFunction(input, fnc) self.InputsTable[input] = fnc end +local function NormalizeOutputParams(params) + local normalized = params + -- Old style and also Hammer disallows comma. + normalized = string.Replace(normalized, ":", ",") + -- Newer source games according to Rubat use this instead of comma. + normalized = string.Replace(normalized, "\x1B", ",") + return normalized +end + function ENT:KeyValue(name, val) DbgPrint(self, "KeyValue", name, val) @@ -311,7 +320,8 @@ function ENT:KeyValue(name, val) end if self.OutputsTable[name] ~= nil then - local params = string.Explode(",", string.Trim(val), false) + local normalized = NormalizeOutputParams(val) + local params = string.Explode(",", string.Trim(normalized), false) local target = params[1] local input = params[2] local param = params[3]