1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Changed the regex on the spy, strike and barrage command to properly process decimals. (#1327)

This commit is contained in:
Soggs 2022-06-29 19:06:46 +02:00 committed by GitHub
parent 34b31769c2
commit 3e232a9fac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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