From 1984c67295d335f207669db0851480a08319afa7 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 28 Jun 2021 01:00:38 +0100 Subject: [PATCH] Vector3, Face, Mesh: unconditionally return class --- worldeditadditions/init.lua | 6 ++++-- worldeditadditions/utils/mesh.lua | 10 +--------- worldeditadditions/utils/vector3.lua | 7 +------ 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/worldeditadditions/init.lua b/worldeditadditions/init.lua index 4a1e1cb..372b896 100644 --- a/worldeditadditions/init.lua +++ b/worldeditadditions/init.lua @@ -8,8 +8,10 @@ worldeditadditions = {} worldeditadditions.modpath = minetest.get_modpath("worldeditadditions") dofile(worldeditadditions.modpath.."/utils/vector.lua") -dofile(worldeditadditions.modpath.."/utils/vector3.lua") -dofile(worldeditadditions.modpath.."/utils/mesh.lua") +worldeditadditions.Vector3 = dofile(worldeditadditions.modpath.."/utils/vector3.lua") +worldeditadditions.Mesh, +worldeditadditions.Face = dofile(worldeditadditions.modpath.."/utils/mesh.lua") + dofile(worldeditadditions.modpath.."/utils/strings/init.lua") dofile(worldeditadditions.modpath.."/utils/format/init.lua") diff --git a/worldeditadditions/utils/mesh.lua b/worldeditadditions/utils/mesh.lua index 3642404..6b0fa58 100644 --- a/worldeditadditions/utils/mesh.lua +++ b/worldeditadditions/utils/mesh.lua @@ -88,12 +88,4 @@ function Mesh.dedupe(self) end -if worldeditadditions then - worldeditadditions.Face = Face - worldeditadditions.Mesh = Mesh -else - return { - Face = Face, - Mesh = Mesh - } -end +return Mesh, Face diff --git a/worldeditadditions/utils/vector3.lua b/worldeditadditions/utils/vector3.lua index 095c3d8..75f6698 100644 --- a/worldeditadditions/utils/vector3.lua +++ b/worldeditadditions/utils/vector3.lua @@ -391,9 +391,4 @@ function Vector3.__tostring(a) end - -if worldeditadditions then - worldeditadditions.Vector3 = Vector3 -else - return Vector3 -end +return Vector3