Skip to content

Commit

Permalink
v2.0.15 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ILLISIS committed Dec 14, 2024
1 parent aabe6c2 commit c742e45
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 2.0.15
Date: 2024-12-14
Bugfixes:
- Added validation to logitstic sections to prevent a crash when all sections were removed from a Constructron.
---------------------------------------------------------------------------------------------------
Version: 2.0.14
Date: 2024-11-30
Changes:
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": "Constructron-Continued",
"version": "2.0.14",
"version": "2.0.15",
"title": "Constructron-Continued",
"author": "ILLISIS",
"homepage": "https://github.com/ILLISIS/Constructron-continued/",
Expand Down
9 changes: 8 additions & 1 deletion script/job.lua
Original file line number Diff line number Diff line change
Expand Up @@ -479,23 +479,30 @@ function job:check_chunks()
end
end

-- this method validates that the worker has roboport euipment
function job:validate_logisitics()
local worker = self.worker ---@cast worker -nil
-- validate logisitic cell (constructrion has roboports)
if not (self.worker_logistic_cell and self.worker_logistic_cell.valid) then
if not worker.logistic_cell then
debug_lib.VisualDebugText("Missing roboports in equipment grid!", worker, -0.5, 5)
return false
end
self.worker_logistic_cell = self.worker.logistic_cell
end
-- validate logisitic network (constructrion has roboports)
if not (self.worker_logistic_network and self.worker_logistic_network.valid) then
if not self.worker_logistic_cell.logistic_network then
debug_lib.VisualDebugText("Missing roboports in equipment grid!", worker, -0.5, 5)
return false
end
self.worker_logistic_network = self.worker_logistic_cell.logistic_network
end
-- validate that there is a logisitic section available, if not create one
local logistic_point = worker.get_logistic_point(0) ---@cast logistic_point -nil
local section = logistic_point.get_section(1)
if not section then
logistic_point.add_section()
end
return true
end

Expand Down

0 comments on commit c742e45

Please sign in to comment.