Fix teleport pipe pump bug
This commit is contained in:
parent
7281ec7af7
commit
bdc6074790
@ -161,19 +161,21 @@ liquid.register_nodes({"techage:ta5_tele_pipe"}, Pipe, "tank", {"L"}, {
|
||||
nvm.oil_amount = nvm.oil_amount or 0
|
||||
if not blocked and techage.is_operational(nvm) then
|
||||
local rmt_pos = teleport.get_remote_pos(pos)
|
||||
local rmt_nvm = techage.get_nvm(rmt_pos)
|
||||
if techage.is_operational(rmt_nvm) then
|
||||
local pipe_dir = M(rmt_pos):get_int("pipe_dir")
|
||||
blocked = true
|
||||
local leftover = liquid.put(rmt_pos, Pipe, pipe_dir, name, amount)
|
||||
blocked = false
|
||||
if leftover < amount then
|
||||
State:keep_running(pos, nvm, COUNTDOWN_TICKS)
|
||||
State:keep_running(rmt_pos, rmt_nvm, COUNTDOWN_TICKS)
|
||||
if rmt_pos then
|
||||
local rmt_nvm = techage.get_nvm(rmt_pos)
|
||||
if techage.is_operational(rmt_nvm) then
|
||||
local pipe_dir = M(rmt_pos):get_int("pipe_dir")
|
||||
blocked = true
|
||||
local leftover = liquid.put(rmt_pos, Pipe, pipe_dir, name, amount)
|
||||
blocked = false
|
||||
if leftover < amount then
|
||||
State:keep_running(pos, nvm, COUNTDOWN_TICKS)
|
||||
State:keep_running(rmt_pos, rmt_nvm, COUNTDOWN_TICKS)
|
||||
end
|
||||
return leftover
|
||||
else
|
||||
State:blocked(pos, nvm, S("Remote block error"))
|
||||
end
|
||||
return leftover
|
||||
else
|
||||
State:blocked(pos, nvm, S("Remote block error"))
|
||||
end
|
||||
end
|
||||
return amount
|
||||
|
Loading…
Reference in New Issue
Block a user