From 5ec877f2b77823dff7298f6bdbe050d3ba5c608c Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Mon, 19 Sep 2022 17:33:02 +0100
Subject: [PATCH] strip remaining worldeditadditions.vector.tostring calls

---
 worldeditadditions/lib/maze2d.lua              | 6 +++---
 worldeditadditions/lib/maze3d.lua              | 6 +++---
 worldeditadditions/lib/overlay.lua             | 4 ++--
 worldeditadditions_commands/commands/torus.lua | 5 +++--
 worldeditadditions_farwand/lib/farwand.lua     | 4 ++--
 worldeditadditions_farwand/lib/multiwand.lua   | 2 +-
 6 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/worldeditadditions/lib/maze2d.lua b/worldeditadditions/lib/maze2d.lua
index 4dac5b8..f4cb509 100644
--- a/worldeditadditions/lib/maze2d.lua
+++ b/worldeditadditions/lib/maze2d.lua
@@ -144,11 +144,11 @@ function worldeditadditions.maze2d(pos1, pos2, target_node, seed, path_length, p
 	local node_id_air = minetest.get_content_id("air")
 	local node_id_target = minetest.get_content_id(target_node)
 
-	-- print("pos1: ", worldeditadditions.vector.tostring(pos1))
-	-- print("pos2: ", worldeditadditions.vector.tostring(pos2))
+	-- print("pos1: ", pos1)
+	-- print("pos2: ", pos2)
 
 
-	-- minetest.log("action", "Generating "..extent.x.."x"..extent.z.." maze (depth "..extent.z..") from pos1 " .. worldeditadditions.vector.tostring(pos1).." to pos2 "..worldeditadditions.vector.tostring(pos2))
+	-- minetest.log("action", "Generating "..extent.x.."x"..extent.z.." maze (depth "..extent.z..") from pos1 " .. pos1.." to pos2 "..pos2)
 	-- print("path_width: "..path_width..", path_length: "..path_length)
 
 	local maze = generate_maze(seed, extent.z, extent.x, path_length, path_width) -- x &   need to be the opposite way around to how we index it
diff --git a/worldeditadditions/lib/maze3d.lua b/worldeditadditions/lib/maze3d.lua
index ab742f8..e7db8ca 100644
--- a/worldeditadditions/lib/maze3d.lua
+++ b/worldeditadditions/lib/maze3d.lua
@@ -192,11 +192,11 @@ function worldeditadditions.maze3d(pos1, pos2, target_node, seed, path_length, p
 	local node_id_air = minetest.get_content_id("air")
 	local node_id_target = minetest.get_content_id(target_node)
 
-	-- minetest.log("action", "pos1: " .. worldeditadditions.vector.tostring(pos1))
-	-- minetest.log("action", "pos2: " .. worldeditadditions.vector.tostring(pos2))
+	-- minetest.log("action", "pos1: " .. pos1)
+	-- minetest.log("action", "pos2: " .. pos2)
 
 
-	-- minetest.log("action", "Generating "..extent.x.."x"..extent.z.."x"..extent.z.." 3d maze from pos1 " .. worldeditadditions.vector.tostring(pos1).." to pos2 "..worldeditadditions.vector.tostring(pos2))
+	-- minetest.log("action", "Generating "..extent.x.."x"..extent.z.."x"..extent.z.." 3d maze from pos1 " .. pos1.." to pos2 "..pos2)
 
 	local maze = generate_maze3d(seed, extent.z, extent.y, extent.x, path_length, path_width, path_depth) -- x & z need to be the opposite way around to how we index it
 	-- printspace3d(maze, extent.z, extent.y, extent.x)
diff --git a/worldeditadditions/lib/overlay.lua b/worldeditadditions/lib/overlay.lua
index 401e6d1..4e1de0c 100644
--- a/worldeditadditions/lib/overlay.lua
+++ b/worldeditadditions/lib/overlay.lua
@@ -16,8 +16,8 @@ function worldeditadditions.overlay(pos1, pos2, node_weights)
 	
 	local node_ids, node_ids_count = wea_c.make_weighted(node_weights)
 	
-	-- minetest.log("action", "pos1: " .. worldeditadditions.vector.tostring(pos1))
-	-- minetest.log("action", "pos2: " .. worldeditadditions.vector.tostring(pos2))
+	-- minetest.log("action", "pos1: " .. pos1)
+	-- minetest.log("action", "pos2: " .. pos2)
 	
 	-- z y x is the preferred loop order, but that isn't really possible here
 	
diff --git a/worldeditadditions_commands/commands/torus.lua b/worldeditadditions_commands/commands/torus.lua
index 07da02b..de68f11 100644
--- a/worldeditadditions_commands/commands/torus.lua
+++ b/worldeditadditions_commands/commands/torus.lua
@@ -100,8 +100,9 @@ worldeditadditions_core.register_command("hollowtorus", {
 	end,
 	func = function(name, target_node, major_radius, minor_radius, axes)
 		local start_time = worldeditadditions.get_ms_time()
+		local pos1 = Vector3.clone(worldedit.pos1[name])
 		local replaced = worldeditadditions.torus(
-			worldedit.pos1[name],
+			pos1,
 			major_radius, minor_radius,
 			target_node,
 			axes,
@@ -109,7 +110,7 @@ worldeditadditions_core.register_command("hollowtorus", {
 		)
 		local time_taken = worldeditadditions.get_ms_time() - start_time
 		
-		minetest.log("action", name .. " used //hollowtorus at " .. worldeditadditions.vector.tostring(worldedit.pos1[name]) .. ", replacing " .. replaced .. " nodes in " .. time_taken .. "s")
+		minetest.log("action", name .. " used //hollowtorus at "..pos1..", replacing " .. replaced .. " nodes in " .. time_taken .. "s")
 		return true, replaced .. " nodes replaced in " .. worldeditadditions.format.human_time(time_taken)
 	end
 })
diff --git a/worldeditadditions_farwand/lib/farwand.lua b/worldeditadditions_farwand/lib/farwand.lua
index a28b8a6..56a9a2a 100644
--- a/worldeditadditions_farwand/lib/farwand.lua
+++ b/worldeditadditions_farwand/lib/farwand.lua
@@ -3,7 +3,7 @@ local function set_pos1(name, pos)
 		-- print("[set_pos1]", name, "("..pos.x..", "..pos.y..", "..pos.z..")")
 		worldedit.pos1[name] = pos
 		worldedit.mark_pos1(name)
-		worldedit.player_notify(name, "pos1 set to "..worldeditadditions.vector.tostring(pos))
+		worldedit.player_notify(name, "pos1 set to "..pos) -- pos is a Vector3
 	else
 		worldedit.player_notify(name, "Error: Too far away (try raising your maxdist with //farwand maxdist <number>)")
 		-- print("[set_pos1]", name, "nil")
@@ -14,7 +14,7 @@ local function set_pos2(name, pos)
 		-- print("[set_pos2]", name, "("..pos.x..", "..pos.y..", "..pos.z..")")
 		worldedit.pos2[name] = pos
 		worldedit.mark_pos2(name)
-		worldedit.player_notify(name, "pos2 set to "..worldeditadditions.vector.tostring(pos))
+		worldedit.player_notify(name, "pos2 set to "..pos)
 	else
 		worldedit.player_notify(name, "Error: Too far away (try raising your maxdist with //farwand maxdist <number>)")
 		-- print("[set_pos2]", name, "nil")
diff --git a/worldeditadditions_farwand/lib/multiwand.lua b/worldeditadditions_farwand/lib/multiwand.lua
index 5360efc..cf4e658 100644
--- a/worldeditadditions_farwand/lib/multiwand.lua
+++ b/worldeditadditions_farwand/lib/multiwand.lua
@@ -1,6 +1,6 @@
 local wea_c = worldeditadditions_core
 local wea = worldeditadditions
-local Vector3 = wea.Vector3
+local Vector3 = wea_c.Vector3
 
 local function push_pos(player_name, pos)
 	if player_name == nil then return end
