Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mesecons
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
mesecons
Commits
6e767a6c
Unverified
Commit
6e767a6c
authored
6 years ago
by
Vitaliy
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make sticky piston stick falling things as well (#436)
parent
9d239cbf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mesecons_pistons/init.lua
+12
-5
12 additions, 5 deletions
mesecons_pistons/init.lua
with
12 additions
and
5 deletions
mesecons_pistons/init.lua
+
12
−
5
View file @
6e767a6c
...
...
@@ -55,7 +55,7 @@ local function piston_get_rules(node)
return
rules
end
local
function
piston_remove_pusher
(
pos
,
node
)
local
function
piston_remove_pusher
(
pos
,
node
,
check_falling
)
local
pistonspec
=
get_pistonspec
(
node
.
name
,
"onname"
)
local
dir
=
vector
.
multiply
(
minetest
.
facedir_to_dir
(
node
.
param2
),
-
1
)
local
pusherpos
=
vector
.
add
(
pos
,
dir
)
...
...
@@ -72,7 +72,14 @@ local function piston_remove_pusher(pos, node)
max_hear_distance
=
20
,
gain
=
0
.
3
,
})
minetest
.
check_for_falling
(
pusherpos
)
if
check_falling
then
minetest
.
check_for_falling
(
pusherpos
)
end
end
local
function
piston_after_dig
(
pos
,
node
)
piston_remove_pusher
(
pos
,
node
,
true
)
end
local
piston_on
=
function
(
pos
,
node
)
...
...
@@ -97,7 +104,7 @@ end
local
function
piston_off
(
pos
,
node
)
local
pistonspec
=
get_pistonspec
(
node
.
name
,
"onname"
)
minetest
.
set_node
(
pos
,
{
param2
=
node
.
param2
,
name
=
pistonspec
.
offname
})
piston_remove_pusher
(
pos
,
node
)
piston_remove_pusher
(
pos
,
node
,
not
pistonspec
.
sticky
)
if
not
pistonspec
.
sticky
then
return
...
...
@@ -293,7 +300,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
paramtype2
=
"facedir"
,
is_ground_content
=
false
,
drop
=
"mesecons_pistons:piston_normal_off"
,
after_dig_node
=
piston_
remove_pusher
,
after_dig_node
=
piston_
after_dig
,
node_box
=
piston_on_box
,
selection_box
=
piston_on_box
,
sounds
=
default
.
node_sound_wood_defaults
(),
...
...
@@ -371,7 +378,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
paramtype2
=
"facedir"
,
is_ground_content
=
false
,
drop
=
"mesecons_pistons:piston_sticky_off"
,
after_dig_node
=
piston_
remove_pusher
,
after_dig_node
=
piston_
after_dig
,
node_box
=
piston_on_box
,
selection_box
=
piston_on_box
,
sounds
=
default
.
node_sound_wood_defaults
(),
...
...
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