Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work-around for maps that have \x1B instead of comma for output args #326

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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