Skip to content

Commit

Permalink
small bugfix in the tick-function
Browse files Browse the repository at this point in the history
  • Loading branch information
tiriscef committed Aug 13, 2019
1 parent f98d84f commit 295821c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions pyveganism/changelog.txt
@@ -1,3 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.0.8
Date: 2019.08.12
Bugfixes:
- Fixed a crash when the loop in the on_tick-function stopped at an entity that got removed before the next call to the on_tick-function

---------------------------------------------------------------------------------------------------
Version: 0.0.7
Date: 2019.08.06
Expand Down
8 changes: 4 additions & 4 deletions pyveganism/control.lua
Expand Up @@ -446,15 +446,15 @@ function tick()
local register = global.registered_machines
local index = global.last_index
local current_entity
local checks = global.max_checks
local number_of_checks = global.max_checks

if index and register[index] then
current_entity = register[index]
current_entity = register[index] -- continue looping
else
index, current_entity = next(register, index)
index, current_entity = next(register, nil) -- begin a new loop at the start (nil as a key returns the first pair)
end

while index and count < checks do
while index and count < number_of_checks do
check_registered_entity(current_entity)
index, current_entity = next(register, index)
count = count + 1
Expand Down
4 changes: 2 additions & 2 deletions pyveganism/info.json
@@ -1,9 +1,9 @@
{
"name": "pyveganism",
"version": "0.0.7",
"version": "0.0.8",
"title": "pY Veganism [ALPHA]",
"author": "tiriscef",
"contact": "",
"contact": "tiriscef@protonmail.com",
"homepage": "https://forums.factorio.com/viewtopic.php?f=219&t=71587",
"factorio_version": "0.17",
"dependencies": [
Expand Down

0 comments on commit 295821c

Please sign in to comment.