fix(client/zoneCreator): no more wild rhombus

This commit is contained in:
DokaDoka
2022-09-15 20:57:10 +10:00
parent 5efec8a114
commit 18fa0b6391

View File

@@ -130,16 +130,16 @@ local function startCreator(arg)
drawLines() drawLines()
elseif zoneType == 'box' then elseif zoneType == 'box' then
local offset = math.rad(heading + 45) local rad = math.rad(heading)
local sinT = math.sin(offset) local sinH = math.sin(rad)
local cosT = math.cos(offset) local cosH = math.cos(rad)
local center = vec(xCoord, yCoord) local center = vec(xCoord, yCoord)
---@type vector2[] ---@type vector2[]
points = { points = {
center + vec(width * sinT, length * cosT), center + vec((width * cosH + length * sinH), (length * cosH - width * sinH)),
center + vec(-width * cosT, length * sinT), center + vec(-(width * cosH - length * sinH), (length * cosH + width * sinH)),
center + vec(-width * sinT, -length * cosT), center + vec(-(width * cosH + length * sinH), -(length * cosH - width * sinH)),
center + vec(width * cosT, -length * sinT), center + vec((width * cosH - length * sinH), -(length * cosH + width * sinH)),
} }
drawLines() drawLines()