Verion 63,

His Dad [04-16-20 - 21:22]
Verion 63,
Fixed crash in utility for a newsetup (visiblity)
Signed-off-by: His Dad <John@hisdad.org>
Filename
Doc/Changelog.txt
HistOffline.lua
data/utility.lua
history.lua
history.txt
my/visibility.lua
diff --git a/Doc/Changelog.txt b/Doc/Changelog.txt
index 51d8e6d..bc7d676 100644
--- a/Doc/Changelog.txt
+++ b/Doc/Changelog.txt
@@ -1,4 +1,8 @@
-2020-01-28 verion 62
+2020-04-17 vesrion 63
+Fix crash in Utility at startup on a new installation.
+
+
+2020-01-28 version 62
 Add Harrowstorm

 2019-11-03 version 61
diff --git a/HistOffline.lua b/HistOffline.lua
index 14b4a91..771c185 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -17,7 +17,7 @@ Settings_s ="./my/visibility.lua"
 --force_lang = "fr"  --	or "de" or "fr"  for debugging

 -- ========================
-version= "62"
+version= "63"
 require( "iuplua" )
 require( "iupluacontrols" )

diff --git a/data/utility.lua b/data/utility.lua
index a6fa5d3..f733be0 100644
--- a/data/utility.lua
+++ b/data/utility.lua
@@ -66,17 +66,21 @@ load_visibility=function()
 	local infile = io.open(Settings_s, "r")

 	if infile == nil then
-		print (Settings_s .. "  not there")
-
+		print (Settings_s .. "  not there, that's ok.")
 		return false
 	end
 	io.close(infile)

 	local acc, playerID, visible
+
 	for line in io.lines(Settings_s) do
+
 		acc,  playerID, visible =  string.match(line, "(%S+) (%S+) (%S+)")
+		-- char might have been deleted or might be new setup.
+
+		if(accounts[acc] == nil) then return false end
+		if(accounts[acc].player == nil) then return false end

-		-- char might have been deleted.
 		if(accounts[acc].player[playerID] ~= nil) then
 			if visible == "true" then
 				accounts[acc].player[playerID].visible= true
@@ -84,11 +88,7 @@ load_visibility=function()
 				accounts[acc].player[playerID].visible= false
 			end
 		end
-
-
 	end
-
-
 end


@@ -276,7 +276,7 @@ Reverse_Dat = function (dat_t,ids_t)
 			print("Location " .. Location .. " not found in Locations2Key")
 			return
 		end
-
+
 		local key = Locations2Key[location_t.Location].key
 		local link= location_t["link1"] ~= nil
 		local gotid = (type(ids_t[id]) == "table")		-- do we have this achievement? nil is no. table is yes
diff --git a/history.lua b/history.lua
index 35d5d30..342b575 100644
--- a/history.lua
+++ b/history.lua
@@ -1,6 +1,6 @@
 hist = {
 	name = "history",
-	version = 62,
+	version = 63,
 	initialised = false,
 	SV={},
 	L={},
diff --git a/history.txt b/history.txt
index 5b53e5d..96a2099 100644
--- a/history.txt
+++ b/history.txt
@@ -1,6 +1,6 @@
 ## Title: Dad's History
 ## APIVersion: 100029 100030
-## Version: 61
+## Version: 63
 ## Author: HisDad
 ## Description: Record progress of all characters for offline viewing. No in-game interface.
 ## SavedVariables: History_SV
diff --git a/my/visibility.lua b/my/visibility.lua
index 4a3a07a..6023cea 100644
--- a/my/visibility.lua
+++ b/my/visibility.lua
@@ -1,9 +1 @@
-@Jerm01 Jermjitsu true
-@Hisdad 8796093023767539 false
-@Hisdad 8796093029425371 false
-@Hisdad 8796093034335667 false
-@Hisdad 8796093045937121 true
-@Hisdad 8796093035066365 false
-@Hisdad 8796093022868057 false
-@Hisdad 8796093025489301 false
-@Hisdad 8796093023954155 false
+@Theautumnwinds 8796093050495301 true