From af045dcd8b4568df55a290eb59cc443202c13a58 Mon Sep 17 00:00:00 2001
From: sfan5 <sfan5@live.de>
Date: Wed, 10 Jun 2020 14:50:49 +0200
Subject: [PATCH] sethome: Do not write empty homes file

---
 mods/sethome/init.lua | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mods/sethome/init.lua b/mods/sethome/init.lua
index bad7806d..71874a99 100644
--- a/mods/sethome/init.lua
+++ b/mods/sethome/init.lua
@@ -32,6 +32,9 @@ sethome.set = function(name, pos)
 	player:set_attribute("sethome:home", minetest.pos_to_string(pos))
 
 	-- remove `name` from the old storage file
+	if not homepos[name] then
+		return true
+	end
 	local data = {}
 	local output = io.open(homes_file, "w")
 	if output then
-- 
GitLab