Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xdecor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
xdecor
Commits
6f773427
Commit
6f773427
authored
8 years ago
by
JPG
Browse files
Options
Downloads
Patches
Plain Diff
Mechanisms: Fix empty table checking
parent
bcd89814
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cooking.lua
+1
-1
1 addition, 1 deletion
src/cooking.lua
src/mechanisms.lua
+5
-7
5 additions, 7 deletions
src/mechanisms.lua
with
6 additions
and
8 deletions
src/cooking.lua
+
1
−
1
View file @
6f773427
...
...
@@ -88,7 +88,7 @@ end
function
cauldron
.
boiling_timer
(
pos
)
local
node
=
minetest
.
get_node
(
pos
)
local
objs
=
minetest
.
get_objects_inside_radius
(
pos
,
0
.
5
)
if
objs
==
{}
then
return
true
end
if
not
next
(
objs
)
then
return
true
end
local
ingredients
=
{}
for
_
,
obj
in
pairs
(
objs
)
do
...
...
This diff is collapsed.
Click to expand it.
src/mechanisms.lua
+
5
−
7
View file @
6f773427
...
...
@@ -32,14 +32,14 @@ end
function
plate
.
timer
(
pos
)
local
objs
=
minetest
.
get_objects_inside_radius
(
pos
,
0
.
8
)
if
objs
==
{}
or
not
doors
.
get
then
return
true
end
if
not
next
(
objs
)
or
not
doors
.
get
then
return
true
end
local
minp
=
{
x
=
pos
.
x
-
2
,
y
=
pos
.
y
,
z
=
pos
.
z
-
2
}
local
maxp
=
{
x
=
pos
.
x
+
2
,
y
=
pos
.
y
,
z
=
pos
.
z
+
2
}
local
doors
=
minetest
.
find_nodes_in_area
(
minp
,
maxp
,
"group:door"
)
for
_
,
player
in
pairs
(
objs
)
do
if
player
:
is_player
()
then
for
i
=
1
,
#
doors
do
for
i
=
1
,
#
doors
do
door_toggle
(
pos
,
doors
[
i
],
player
)
end
break
...
...
@@ -92,15 +92,13 @@ xdecor.register("lever_off", {
sounds
=
default
.
node_sound_stone_defaults
(),
sunlight_propagates
=
true
,
on_rotate
=
screwdriver
.
rotate_simple
,
on_rightclick
=
function
(
pos
,
node
,
clicker
,
itemstack
,
pointed_thing
)
if
not
doors
.
get
then
return
itemstack
end
on_rightclick
=
function
(
pos
,
node
,
clicker
,
itemstack
)
if
not
doors
.
get
then
return
itemstack
end
local
minp
=
{
x
=
pos
.
x
-
2
,
y
=
pos
.
y
-
1
,
z
=
pos
.
z
-
2
}
local
maxp
=
{
x
=
pos
.
x
+
2
,
y
=
pos
.
y
+
1
,
z
=
pos
.
z
+
2
}
local
doors
=
minetest
.
find_nodes_in_area
(
minp
,
maxp
,
"group:door"
)
for
i
=
1
,
#
doors
do
for
i
=
1
,
#
doors
do
door_toggle
(
pos
,
doors
[
i
],
clicker
)
end
return
itemstack
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment