diff --git a/control.lua b/control.lua index e0bae7a..0deb348 100644 --- a/control.lua +++ b/control.lua @@ -1,7 +1,14 @@ script.on_event(defines.events.on_built_entity, function(event) if event.created_entity.name == "tf-cokery-dummy" then - game.get_surface("nauvis").create_entity{name = "tf-cokery", position = event.created_entity.position, force = game.forces.player} + local player = game.players[event.player_index] + + player.surface.create_entity({ + name = "tf-cokery", + position = event.created_entity.position, + force = player.force + }) + -- regardless of whether the cookery was created successfully or not, we still want to destroy the placeholder object event.created_entity.destroy() end end) \ No newline at end of file diff --git a/info.json b/info.json index ef7f179..8318ddb 100644 --- a/info.json +++ b/info.json @@ -6,7 +6,5 @@ "author": "drs, Blu3wolf, Treefarm Team", "homepage": "https://github.com/Blu3wolf/Treefarm-AC", "dependencies": ["base >= 0.13.0","Treefarm-Lite >= 0.5.1"], - "description": "This mod adds optional content to the treefarm like coke production, fertilizer production and biomass. - -Published under the GPLv3" + "description": "This mod adds optional content to the treefarm like coke production, fertilizer production and biomass.\r\nPublished under the GPLv3" } diff --git a/migrations/012-013.lua b/migrations/012-013.lua index fadbb44..1b97c78 100644 --- a/migrations/012-013.lua +++ b/migrations/012-013.lua @@ -1,2 +1,4 @@ -game.player.force.resettechnologies() -game.player.force.resetrecipes() \ No newline at end of file +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end \ No newline at end of file diff --git a/migrations/012-013new.lua b/migrations/012-013new.lua index fadbb44..1b97c78 100644 --- a/migrations/012-013new.lua +++ b/migrations/012-013new.lua @@ -1,2 +1,4 @@ -game.player.force.resettechnologies() -game.player.force.resetrecipes() \ No newline at end of file +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end \ No newline at end of file diff --git a/migrations/013-014.lua b/migrations/013-014.lua index fadbb44..3b714f6 100644 --- a/migrations/013-014.lua +++ b/migrations/013-014.lua @@ -1,2 +1,4 @@ -game.player.force.resettechnologies() -game.player.force.resetrecipes() \ No newline at end of file +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end diff --git a/migrations/014-015.lua b/migrations/014-015.lua index fadbb44..1b97c78 100644 --- a/migrations/014-015.lua +++ b/migrations/014-015.lua @@ -1,2 +1,4 @@ -game.player.force.resettechnologies() -game.player.force.resetrecipes() \ No newline at end of file +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end \ No newline at end of file