mirror of
https://github.com/joe7575/techpack.git
synced 2024-12-25 23:17:36 +01:00
Controller bugs fixed
This commit is contained in:
parent
e011819891
commit
2813fa08a0
4
.gitignore
vendored
4
.gitignore
vendored
@ -42,4 +42,6 @@ luac.out
|
||||
.buildpath
|
||||
.project
|
||||
org.eclipse.*
|
||||
*.lua.new
|
||||
*.lua.new
|
||||
|
||||
test_*.lua
|
6
safer_lua/.gitignore
vendored
6
safer_lua/.gitignore
vendored
@ -1,6 +0,0 @@
|
||||
.buildpath
|
||||
.project
|
||||
org.eclipse.*
|
||||
|
||||
|
||||
test_*.lua
|
@ -51,6 +51,7 @@ minetest.register_node("sl_controller:battery", {
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("content", sl_controller.battery_capacity)
|
||||
on_timer(pos, 1)
|
||||
minetest.get_node_timer(pos):start(30)
|
||||
end,
|
||||
|
||||
@ -60,6 +61,7 @@ minetest.register_node("sl_controller:battery", {
|
||||
sunlight_propagates = true,
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy=1, cracky=1, crumbly=1},
|
||||
drop = "",
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
@ -20,6 +20,9 @@ SaferLua is a subset of Lua with the following restrictions:
|
||||
- Limited set of available functions
|
||||
- Store() as alternative to Lua tables
|
||||
|
||||
The controller needs a battery nearby.
|
||||
Don't remove the battery, it will be destroyed!
|
||||
|
||||
See: goo.gl/WRWZgt
|
||||
]]
|
||||
|
||||
@ -261,7 +264,7 @@ end
|
||||
local function on_timer(pos, elapsed)
|
||||
local t = minetest.get_us_time()
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_int("state") ~= "running" then
|
||||
if meta:get_int("state") ~= tubelib.RUNNING then
|
||||
return false
|
||||
end
|
||||
local number = meta:get_string("number")
|
||||
|
Loading…
Reference in New Issue
Block a user