Skip to content

Commit

Permalink
fix(client/compat): convert BoxZone Z coords
Browse files Browse the repository at this point in the history
z is more likely to match minZ, creating a zone that is centred on the minZ.
  • Loading branch information
thelindat committed Nov 22, 2022
1 parent 45ddd51 commit 5f789d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/compat/qb-target.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ local function convert(options)
end

exportHandler('AddBoxZone', function(name, center, length, width, options, targetoptions)
local z = center.z

if not options.useZ then
z = z + math.abs(options.maxZ - options.minZ) / 2
center = vec3(center.x, center.y, z)
end

return lib.zones.box({
name = name,
coords = center,
Expand Down
7 changes: 7 additions & 0 deletions client/compat/qtarget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ local function convert(options)
end

exportHandler('AddBoxZone', function(name, center, length, width, options, targetoptions)
local z = center.z

if not options.useZ then
z = z + math.abs(options.maxZ - options.minZ) / 2
center = vec3(center.x, center.y, z)
end

return lib.zones.box({
name = name,
coords = center,
Expand Down

0 comments on commit 5f789d8

Please sign in to comment.