bugfix for power outage on KI core
This commit is contained in:
parent
94663f6f78
commit
c02dce9248
2 changed files with 27 additions and 0 deletions
|
@ -419,6 +419,13 @@ function el_ki_core_working()
|
|||
local oldactive = global.ki.core[i].active
|
||||
global.ki.core[i].active = global.ki.core[i].entity.is_crafting()
|
||||
|
||||
if global.ki.core[i].active then
|
||||
if global.ki.core[i].entity.energy < global.ki.core[i].entity.prototype.energy_usage then
|
||||
global.ki.core[i].active = false
|
||||
global.ki.dirty = true
|
||||
end
|
||||
end
|
||||
|
||||
if not oldactive == global.ki.core[i].active then
|
||||
global.ki.dirty = true
|
||||
end
|
||||
|
@ -432,6 +439,13 @@ function el_ki_buffer1_working()
|
|||
local oldactive = global.ki.buffer1[i].active
|
||||
global.ki.buffer1[i].active = global.ki.buffer1[i].entity.is_crafting()
|
||||
|
||||
if global.ki.buffer1[i].active then
|
||||
if global.ki.buffer1[i].entity.energy < global.ki.buffer1[i].entity.prototype.energy_usage then
|
||||
global.ki.buffer1[i].active = false
|
||||
global.ki.dirty = true
|
||||
end
|
||||
end
|
||||
|
||||
if not oldactive == global.ki.buffer1[i].active then
|
||||
global.ki.dirty = true
|
||||
end
|
||||
|
@ -457,6 +471,13 @@ function el_ki_buffer2_working()
|
|||
local oldactive = global.ki.buffer2[i].active
|
||||
global.ki.buffer2[i].active = global.ki.buffer2[i].entity.is_crafting()
|
||||
|
||||
if global.ki.buffer2[i].active then
|
||||
if global.ki.buffer2[i].entity.energy < global.ki.buffer2[i].entity.prototype.energy_usage then
|
||||
global.ki.buffer2[i].active = false
|
||||
global.ki.dirty = true
|
||||
end
|
||||
end
|
||||
|
||||
if not oldactive == global.ki.buffer2[i].active then
|
||||
global.ki.dirty = true
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue