Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
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
minetest_game
Commits
a1aee9a6
Commit
a1aee9a6
authored
10 years ago
by
Zefram
Committed by
BlockMen
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix door hardness detection for open/close sounds
parent
5dbc738d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mods/doors/init.lua
+3
-12
3 additions, 12 deletions
mods/doors/init.lua
with
3 additions
and
12 deletions
mods/doors/init.lua
+
3
−
12
View file @
a1aee9a6
...
...
@@ -16,17 +16,6 @@ doors = {}
-- only_placer_can_open: if true only the player who placed the door can
-- open it
local
function
is_right
(
pos
)
local
r1
=
minetest
.
get_node
({
x
=
pos
.
x
-
1
,
y
=
pos
.
y
,
z
=
pos
.
z
})
local
r2
=
minetest
.
get_node
({
x
=
pos
.
x
,
y
=
pos
.
y
,
z
=
pos
.
z
-
1
})
if
string.find
(
r1
.
name
,
"door_"
)
or
string.find
(
r2
.
name
,
"door_"
)
then
if
string.find
(
r1
.
name
,
"_1"
)
or
string.find
(
r2
.
name
,
"_1"
)
then
return
true
else
return
false
end
end
end
function
doors
.
register_door
(
name
,
def
)
def
.
groups
.
not_in_creative_inventory
=
1
...
...
@@ -104,6 +93,8 @@ function doors.register_door(name, def)
else
minetest
.
set_node
(
pt
,
{
name
=
name
..
"_b_2"
,
param2
=
p2
})
minetest
.
set_node
(
pt2
,
{
name
=
name
..
"_t_2"
,
param2
=
p2
})
minetest
.
get_meta
(
pt
):
set_int
(
"right"
,
1
)
minetest
.
get_meta
(
pt2
):
set_int
(
"right"
,
1
)
end
if
def
.
only_placer_can_open
then
...
...
@@ -153,7 +144,7 @@ function doors.register_door(name, def)
snd_2
=
def
.
sound_close_door
end
if
is_right
(
pos
)
then
if
minetest
.
get_meta
(
pos
):
get_int
(
"right"
)
~=
0
then
minetest
.
sound_play
(
snd_1
,
{
pos
=
pos
,
gain
=
0
.
3
,
max_hear_distance
=
10
})
else
minetest
.
sound_play
(
snd_2
,
{
pos
=
pos
,
gain
=
0
.
3
,
max_hear_distance
=
10
})
...
...
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