mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
fix(zonecreator): vector formatting on some systems (#683)
This commit is contained in:
@@ -37,6 +37,10 @@ exports.ox_target:addPolyZone({
|
|||||||
})
|
})
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
local function formatNumber(num)
|
||||||
|
return tostring(num):gsub(",", ".")
|
||||||
|
end
|
||||||
|
|
||||||
local parse = {
|
local parse = {
|
||||||
poly = function(data)
|
poly = function(data)
|
||||||
local points = {}
|
local points = {}
|
||||||
@@ -82,18 +86,34 @@ local parse = {
|
|||||||
pattern = {
|
pattern = {
|
||||||
'local box = lib.zones.box({\n',
|
'local box = lib.zones.box({\n',
|
||||||
('\tname = "%s",\n'):format(data.name),
|
('\tname = "%s",\n'):format(data.name),
|
||||||
('\tcoords = vec3(%s, %s, %s),\n'):format(data.xCoord, data.yCoord, data.zCoord),
|
('\tcoords = vec3(%s, %s, %s),\n'):format(
|
||||||
('\tsize = vec3(%s, %s, %s),\n'):format(data.width, data.length, data.height),
|
formatNumber(data.xCoord),
|
||||||
('\trotation = %s,\n'):format(data.heading),
|
formatNumber(data.yCoord),
|
||||||
|
formatNumber(data.zCoord)
|
||||||
|
),
|
||||||
|
('\tsize = vec3(%s, %s, %s),\n'):format(
|
||||||
|
formatNumber(data.width),
|
||||||
|
formatNumber(data.length),
|
||||||
|
formatNumber(data.height)
|
||||||
|
),
|
||||||
|
('\trotation = %s,\n'):format(formatNumber(data.heading)),
|
||||||
'})\n',
|
'})\n',
|
||||||
}
|
}
|
||||||
elseif data.format == 'array' then
|
elseif data.format == 'array' then
|
||||||
pattern = {
|
pattern = {
|
||||||
'{\n',
|
'{\n',
|
||||||
('\tname = "%s",\n'):format(data.name),
|
('\tname = "%s",\n'):format(data.name),
|
||||||
('\tcoords = vec3(%s, %s, %s),\n'):format(data.xCoord, data.yCoord, data.zCoord),
|
('\tcoords = vec3(%s, %s, %s),\n'):format(
|
||||||
('\tsize = vec3(%s, %s, %s),\n'):format(data.width, data.length, data.height),
|
formatNumber(data.xCoord),
|
||||||
('\trotation = %s,\n'):format(data.heading),
|
formatNumber(data.yCoord),
|
||||||
|
formatNumber(data.zCoord)
|
||||||
|
),
|
||||||
|
('\tsize = vec3(%s, %s, %s),\n'):format(
|
||||||
|
formatNumber(data.width),
|
||||||
|
formatNumber(data.length),
|
||||||
|
formatNumber(data.height)
|
||||||
|
),
|
||||||
|
('\trotation = %s,\n'):format(formatNumber(data.heading)),
|
||||||
'},\n',
|
'},\n',
|
||||||
}
|
}
|
||||||
elseif data.format == 'target' then
|
elseif data.format == 'target' then
|
||||||
|
|||||||
Reference in New Issue
Block a user