Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Illuna-Minetest
minetest_game
Commits
5e0c4934
Commit
5e0c4934
authored
Jul 06, 2014
by
BlockMen
Browse files
Fix boats again
parent
584718a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
mods/boats/init.lua
View file @
5e0c4934
...
...
@@ -40,6 +40,7 @@ local boat = {
driver
=
nil
,
v
=
0
,
last_v
=
0
,
removed
=
false
}
function
boat
.
on_rightclick
(
self
,
clicker
)
...
...
@@ -76,9 +77,18 @@ function boat.get_staticdata()
end
function
boat
.
on_punch
(
self
,
puncher
,
time_from_last_punch
,
tool_capabilities
,
direction
)
if
not
puncher
or
not
puncher
:
is_player
()
or
self
.
removed
then
return
end
puncher
:
set_detach
()
self
.
object
:
remove
()
if
puncher
and
puncher
:
is_player
()
and
not
minetest
.
setting_getbool
(
"creative_mode"
)
then
default
.
player_attached
[
puncher
:
get_player_name
()]
=
false
self
.
removed
=
true
-- delay remove to ensure player is detached
minetest
.
after
(
0
.
1
,
function
()
self
.
object
:
remove
()
end
)
if
not
minetest
.
setting_getbool
(
"creative_mode"
)
then
puncher
:
get_inventory
():
add_item
(
"main"
,
"boats:boat"
)
end
end
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment