Skip to content

Commit

Permalink
Merge pull request #326 from GMLambda/icarus-fix
Browse files Browse the repository at this point in the history
Work-around for maps that have \x1B instead of comma for output args
  • Loading branch information
ZehMatt authored Nov 3, 2024
2 parents 1e8066e + 2560968 commit 55276bf
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 55276bf

Please sign in to comment.