From 3e232a9fac425844dd6af33965319b4bf0060207 Mon Sep 17 00:00:00 2001 From: Soggs Date: Wed, 29 Jun 2022 19:06:46 +0200 Subject: [PATCH] Changed the regex on the spy, strike and barrage command to properly process decimals. (#1327) --- map_gen/maps/crash_site/commands.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/map_gen/maps/crash_site/commands.lua b/map_gen/maps/crash_site/commands.lua index ae0d86f3..6144c98b 100644 --- a/map_gen/maps/crash_site/commands.lua +++ b/map_gen/maps/crash_site/commands.lua @@ -270,7 +270,7 @@ function Public.control(config) local coords = {} local spy_cost = 100 - for m in string.gmatch(location_string, "%-?%d+") do -- Assuming the surface name isn't a valid number. + for m in string.gmatch(location_string, "(%-?%d*%.?%d+)") do -- Assuming the surface name isn't a valid number. table.insert(coords, tonumber(m)) end -- Do some checks on the coordinates passed in the argument @@ -398,7 +398,7 @@ function Public.control(config) local strikeCost = count * 4 -- the number of poison-capsules required in the chest as payment -- parse GPS coordinates from map ping - for m in string.gmatch(location_string, "%-?%d+") do -- Assuming the surface name isn't a valid number. + for m in string.gmatch(location_string, "(%-?%d*%.?%d+)") do -- Assuming the surface name isn't a valid number. table.insert(coords, tonumber(m)) end @@ -491,7 +491,7 @@ function Public.control(config) local strikeCost = count * 4 -- parse GPS coordinates from map ping - for m in string.gmatch(location_string, "%-?%d+") do -- Assuming the surface name isn't a valid number. + for m in string.gmatch(location_string, "(%-?%d*%.?%d+)") do -- Assuming the surface name isn't a valid number. table.insert(coords, tonumber(m)) end