From 725ddd9b8c0bd9f4abb58e627d9ab62c918960b1 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sun, 29 Nov 2020 00:47:59 -0700 Subject: [PATCH] sanitize waypoint type names with colons for filenames --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 6b29a15..197dc22 100644 --- a/init.lua +++ b/init.lua @@ -32,7 +32,7 @@ named_waypoints.register_named_waypoints = function(waypoints_type, waypoints_de waypoint_defs[waypoints_type] = waypoints_def player_huds[waypoints_type] = {} - local areastore_filename = worldpath.."/named_waypoints_".. waypoints_type ..".txt" + local areastore_filename = worldpath.."/named_waypoints_".. string.gsub(waypoints_type, ":", "_") ..".txt" local area_file = io.open(areastore_filename, "r") local areastore = AreaStore() if area_file then @@ -43,7 +43,7 @@ named_waypoints.register_named_waypoints = function(waypoints_type, waypoints_de end local function save(waypoints_type) - local areastore_filename = worldpath.."/named_waypoints_".. waypoints_type ..".txt" + local areastore_filename = worldpath.."/named_waypoints_".. string.gsub(waypoints_type, ":", "_") ..".txt" local areastore = waypoint_areastores[waypoints_type] if areastore then areastore:to_file(areastore_filename)