Skip to content

Commit

Permalink
Merge pull request #15 from jodokus31/master
Browse files Browse the repository at this point in the history
Release 0.5.9 Bugfixes
  • Loading branch information
jodokus31 authored Dec 27, 2023
2 parents 7943c76 + 0a52878 commit 773557c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 0.5.9
Date: 2023-12-27
Bugfixes:
- Fix bug, when upgrading underground pipes.
- Try to fix bug, when upgrading only the direction of entities. Not repro for me, but I added some additional nil checks
---------------------------------------------------------------------------------------------------
Version: 0.5.8
Date: 2023-07-16
Changes:
Expand Down
6 changes: 2 additions & 4 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ local function try_upgrade_single_entity(entity, target_name, player)
-- same entity name: f.e. upgrade belt to belt
local direction = entity.get_upgrade_direction()
-- simply change direction
if entity.direction ~= direction then
if direction and entity.direction and entity.direction ~= direction then
entity.direction = direction
entity.cancel_upgrade(player.force, player)
return SUCCESS_DONE_ALL
Expand Down Expand Up @@ -462,9 +462,7 @@ local function try_upgrade(entity, player, state)
local target_name = target_prototype.name

if entity.type == "underground-belt" and entity.neighbours then
return try_upgrade_paired_entity(entity, entity.neighbours, target_name, player, true)
elseif entity.type == "pipe-to-ground" and entity.neighbours[1] and entity.neighbours[1][1] then
return try_upgrade_paired_entity(entity, entity.neighbours[1][1], target_name, player, false)
return try_upgrade_paired_entity(entity, entity.neighbours, target_name, player, true)
else
return try_upgrade_single_entity(entity, target_name, player)
end
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autobuild",
"version": "0.5.8",
"version": "0.5.9",
"factorio_version": "1.1",
"title": "Autobuild",
"author": "Therax",
Expand Down

0 comments on commit 773557c

Please sign in to comment.