Prototype: Fix shitty string serialisation, Lua offers %q fmt

This commit is contained in:
Nero 2022-06-19 16:20:59 +00:00
parent 159c336d5a
commit c5deb5c458
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ function Prototype:__tostring()
elseif t=="number" or t=="boolean" then
return tostring(self)
elseif t=="string" then
return "\""..self:gsub("\\","\\\\"):gsub("\"","\\\"").."\""
return ("%q"):format(self)
else
return "nil"
end