mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
Auto adjust boxes with poorly set minZ and maxZ
Automatically adjusts box targets for custom locations that have been set wrong if minZ is too high, adjust it if maxZ is too low, adjust it and warn the client that the target has to be adjusted. Solves people opening tickets because they half edited a location without reading my docs
This commit is contained in:
@@ -956,4 +956,18 @@ end
|
||||
function GetEntityForwardVector(entity)
|
||||
local heading = math.rad(GetEntityHeading(entity) + 90)
|
||||
return vec3(math.cos(heading), math.sin(heading), 0.0)
|
||||
end
|
||||
|
||||
function adjustMinMaxZ(coord, table)
|
||||
local table = table
|
||||
local adMinZ, adMaxZ = false, false
|
||||
if table.minZ > coord.z then
|
||||
adMinZ = true
|
||||
table.minZ = (coord.z - 1.05)
|
||||
end
|
||||
if table.maxZ < coord.z then
|
||||
adMinZ = true
|
||||
table.maxZ = (coord.z + 0.80)
|
||||
end
|
||||
return table.minZ, table.maxZ, adMinZ, adMaxZ
|
||||
end
|
||||
Reference in New Issue
Block a user