Skip to content

Commit

Permalink
Work-around for maps that have \x1B instead of comma for output args
Browse files Browse the repository at this point in the history
  • Loading branch information
ZehMatt committed Nov 3, 2024
1 parent 1e8066e commit 2560968
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion entities/entities/lambda_entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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]
Expand Down

0 comments on commit 2560968

Please sign in to comment.