From 5ba3b262b16da396e9156d27878b8d213a156a06 Mon Sep 17 00:00:00 2001 From: Yagira Date: Mon, 18 Sep 2023 00:32:03 +0200 Subject: [PATCH] keep original proxy data in .vmt files #1308 --- lua/pac3/core/shared/util.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/pac3/core/shared/util.lua b/lua/pac3/core/shared/util.lua index 0a83a3d9..36c1e79b 100644 --- a/lua/pac3/core/shared/util.lua +++ b/lua/pac3/core/shared/util.lua @@ -597,9 +597,12 @@ function pac.DownloadMDL(url, callback, onfail, ply) for i, data in ipairs(files) do if data.file_name:EndsWith(".vmt") then + local proxies = data.buffer:match('("?%f[%w_]P?p?roxies%f[^%w_]"?%s*%b{})') data.buffer = data.buffer:lower():gsub("\\", "/") - :gsub('("?%f[%w_]playercolor%f[^%w_]"?)','PlayerColor') - :gsub('("?%f[%w_]playerweaponcolor%f[^%w_]"?)','PlayerWeaponColor') + + if proxies then + data.buffer = data.buffer:gsub('("?%f[%w_]proxies%f[^%w_]"?%s*%b{})', proxies) + end if DEBUG_MDL or VERBOSE then print(data.file_name .. ":")