Try to fix kernel crashes

This commit is contained in:
Joachim Stolberg 2023-02-27 19:57:56 +01:00
parent 460cc7eefd
commit 4c3e73b3f9

View File

@ -3,7 +3,7 @@
TechAge TechAge
======= =======
Copyright (C) 2019-2022 Joachim Stolberg Copyright (C) 2019-2023 Joachim Stolberg
AGPL v3 AGPL v3
See LICENSE.txt for more information See LICENSE.txt for more information
@ -31,7 +31,7 @@ end
function techage.shared_inv.node_timer(pos, elapsed) function techage.shared_inv.node_timer(pos, elapsed)
local rmt_pos = remote_pos(pos) local rmt_pos = remote_pos(pos)
if techage.is_activeformspec(pos) then if rmt_pos and techage.is_activeformspec(pos) then
copy_inventory_list(rmt_pos, pos, "main") copy_inventory_list(rmt_pos, pos, "main")
return true return true
end end
@ -42,8 +42,10 @@ end
function techage.shared_inv.before_inv_access(pos, listname) function techage.shared_inv.before_inv_access(pos, listname)
if hyperloop.is_client(pos) then if hyperloop.is_client(pos) then
local rmt_pos = remote_pos(pos) local rmt_pos = remote_pos(pos)
copy_inventory_list(rmt_pos, pos, listname) if rmt_pos then
return true copy_inventory_list(rmt_pos, pos, listname)
return true
end
end end
return false return false
end end
@ -52,8 +54,10 @@ end
function techage.shared_inv.after_inv_access(pos, listname) function techage.shared_inv.after_inv_access(pos, listname)
if hyperloop.is_client(pos) then if hyperloop.is_client(pos) then
local rmt_pos = remote_pos(pos) local rmt_pos = remote_pos(pos)
copy_inventory_list(pos, rmt_pos, listname) if rmt_pos then
return true copy_inventory_list(pos, rmt_pos, listname)
return true
end
end end
return false return false
end end
@ -61,8 +65,10 @@ end
function techage.shared_inv.on_rightclick(pos, clicker, listname) function techage.shared_inv.on_rightclick(pos, clicker, listname)
if hyperloop.is_client(pos) then if hyperloop.is_client(pos) then
local rmt_pos = remote_pos(pos) local rmt_pos = remote_pos(pos)
copy_inventory_list(rmt_pos, pos, listname) if rmt_pos then
techage.set_activeformspec(pos, clicker) copy_inventory_list(rmt_pos, pos, listname)
minetest.get_node_timer(pos):start(2) techage.set_activeformspec(pos, clicker)
minetest.get_node_timer(pos):start(2)
end
end end
end end