Skip to content

Commit 33ffa7e

Browse files
committed
Update code for updated stdlib
1 parent 006257b commit 33ffa7e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

control.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11

22
--Include needed stdlib libs.
33
require "stdlib/config/config"
4-
require "stdlib/core"
54
require "stdlib/entity/entity"
5+
require "stdlib/event/gui"
66
require "stdlib/game"
7-
require "stdlib/gui/gui"
87
require "stdlib/log/logger"
9-
require "stdlib/string"
8+
require 'stdlib/utils/string'
109

1110
fm = {}
1211
fm.log = Logger.new("FactorioMaps", "debug", true)

fm/generateMap.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ function fm.generateMap(data)
66
local basePath = "FactorioMaps/" .. data.folderName
77
game.remove_path(basePath)
88

9-
local inGameTotalWidth = math.ceil(math.abs(data.topLeft.x) + math.abs(data.bottomRight.x))
10-
local inGameTotalHeight = math.ceil(math.abs(data.topLeft.y) + math.abs(data.bottomRight.y))
11-
local inGameCenter = Area.center({data.topLeft, data.bottomRight})
9+
local mapArea = Area.normalize(Area.round_to_integer({data.topLeft, data.bottomRight}))
10+
local _ ,inGameTotalWidth, inGameTotalHeight, _ = Area.size(mapArea)
11+
local inGameCenter = Area.center(mapArea)
1212

1313
--Resolution to use for grid sections
1414
local gridSizes = {256, 512, 1024, 2048}

info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "FactorioMaps",
3-
"version": "0.16.0",
3+
"version": "0.16.1",
44
"title": "Google Maps Factorio style",
55
"author": "jeroon, credomane",
66
"contact": "https://github.com/credomane/",

0 commit comments

Comments
 (0)