From 7a176dd44db1a8199fb4fe806b628e84c5abcc31 Mon Sep 17 00:00:00 2001 From: kibukj Date: Sun, 18 Jul 2021 11:46:56 -0400 Subject: [PATCH] Only export objects to ymap --- client.lua | 78 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/client.lua b/client.lua index ca6dfa8..9c74709 100644 --- a/client.lua +++ b/client.lua @@ -1765,48 +1765,50 @@ function ConvertDatabaseToYmap(database) local entitiesXml = '\t\n' for entity, properties in pairs(database.spawn) do - local q = toQuaternion(properties.pitch, properties.roll, properties.yaw) + if properties.type == 3 then + local q = toQuaternion(properties.pitch, properties.roll, properties.yaw) - if not minX or properties.x < minX then - minX = properties.x - end - if not maxX or properties.x > maxX then - maxX = properties.x - end - if not minY or properties.y < minY then - minY = properties.y - end - if not maxY or properties.y > maxY then - maxY = properties.y - end - if not minZ or properties.z < minZ then - minZ = properties.z - end - if not maxZ or properties.z > maxZ then - maxZ = properties.z - end + if not minX or properties.x < minX then + minX = properties.x + end + if not maxX or properties.x > maxX then + maxX = properties.x + end + if not minY or properties.y < minY then + minY = properties.y + end + if not maxY or properties.y > maxY then + maxY = properties.y + end + if not minZ or properties.z < minZ then + minZ = properties.z + end + if not maxZ or properties.z > maxZ then + maxZ = properties.z + end - local flags = 1572865 + local flags = 1572865 - if properties.isFrozen then - flags = flags + 32 - end + if properties.isFrozen then + flags = flags + 32 + end - entitiesXml = entitiesXml .. '\t\t\n' - entitiesXml = entitiesXml .. '\t\t\t' .. properties.name .. '\n' - entitiesXml = entitiesXml .. '\t\t\t\n' - entitiesXml = entitiesXml .. string.format('\t\t\t\n', properties.x, properties.y, properties.z) - entitiesXml = entitiesXml .. string.format('\t\t\t\n', q.w, q.x, q.y, q.z) - entitiesXml = entitiesXml .. '\t\t\t\n' - entitiesXml = entitiesXml .. '\t\t\t\n' - entitiesXml = entitiesXml .. '\t\t\t\n' - entitiesXml = entitiesXml .. '\t\t\t\n' - entitiesXml = entitiesXml .. '\t\t\t\n' - entitiesXml = entitiesXml .. '\t\t\tLODTYPES_DEPTH_HD\n' - entitiesXml = entitiesXml .. '\t\t\t\n' - entitiesXml = entitiesXml .. '\t\t\t\n' - entitiesXml = entitiesXml .. '\t\t\t\n' - entitiesXml = entitiesXml .. '\t\t\n' + entitiesXml = entitiesXml .. '\t\t\n' + entitiesXml = entitiesXml .. '\t\t\t' .. properties.name .. '\n' + entitiesXml = entitiesXml .. '\t\t\t\n' + entitiesXml = entitiesXml .. string.format('\t\t\t\n', properties.x, properties.y, properties.z) + entitiesXml = entitiesXml .. string.format('\t\t\t\n', q.w, q.x, q.y, q.z) + entitiesXml = entitiesXml .. '\t\t\t\n' + entitiesXml = entitiesXml .. '\t\t\t\n' + entitiesXml = entitiesXml .. '\t\t\t\n' + entitiesXml = entitiesXml .. '\t\t\t\n' + entitiesXml = entitiesXml .. '\t\t\t\n' + entitiesXml = entitiesXml .. '\t\t\tLODTYPES_DEPTH_HD\n' + entitiesXml = entitiesXml .. '\t\t\t\n' + entitiesXml = entitiesXml .. '\t\t\t\n' + entitiesXml = entitiesXml .. '\t\t\t\n' + entitiesXml = entitiesXml .. '\t\t\n' + end end entitiesXml = entitiesXml .. '\t\n'