Skip to content

Commit

Permalink
FIX crash in 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kuxynator committed Aug 26, 2020
1 parent 8e5104d commit a02767e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v 0.0.5-patch1
- Updated to Factorio version 1.0.0
- Fix crash on start

v 0.0.5
- Updated to Factorio version 0.18

Expand Down
26 changes: 25 additions & 1 deletion src/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,32 @@ local inventories = {
defines.inventory.player_player_trash
}

local items = {
-- ["light-armor"] = 1, --NOTE disable this if the gamer should work a little bit ;-)
["speedy-bot"] = 100,
["speedy-exo"] = 1,
["speedy-robo"] = 1,
["solar-panel-equipment"] = 1
}

script.on_init(
function()

if not remote.interfaces["freeplay"] then return end

-- Add items
local created_items = remote.call("freeplay", "get_created_items")
for k,v in pairs(items) do
created_items[k] = (created_items[k] or 0) + v
end
remote.call("freeplay", "set_created_items", created_items)
end
)

script.on_event(
defines.events.on_player_created,
function(event)
--[[
local player = game.players[event.player_index]
local playerInventory = player.get_main_inventory()
Expand All @@ -27,7 +50,7 @@ script.on_event(
playerInventory.insert({name = "solar-panel-equipment", count = 1})
player.force.technologies["construction-robotics"].researched = true

]]
--player.insert({name = "light-armor", count = 1})
--[[
Expand All @@ -48,6 +71,7 @@ script.on_event(
end]]
end
)

script.on_event(
defines.events.on_research_finished,
function(event)
Expand Down
6 changes: 3 additions & 3 deletions src/info.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "how-it-should-have-started",
"version": "0.0.5",
"factorio_version": "0.18",
"factorio_version": "1.0",
"title": "How It Should Have Started",
"author": "Pawz",
"homepage": "",
"dependencies": ["base >= 0.17.0"],
"description": "Jump straight to building your base with speedy construction bots! Super handy for those times when you have all the initial stuff planned out and don't want to spend time chopping down trees. Adds custom construction bots, roboport and exoskeletons to the player when they join the game. These are equivalent to top tier equipment but cannot be built and will disappear when you research the upper tiers of these technologies. Grants construction research by default to allow ghosts from the start. "
"dependencies": ["base >= 1.0.0"],
"description": "[PATCH] Fix for 1.0. Jump straight to building your base with speedy construction bots! Super handy for those times when you have all the initial stuff planned out and don't want to spend time chopping down trees. Adds custom construction bots, roboport and exoskeletons to the player when they join the game. These are equivalent to top tier equipment but cannot be built and will disappear when you research the upper tiers of these technologies. Grants construction research by default to allow ghosts from the start. "
}

0 comments on commit a02767e

Please sign in to comment.