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
c51ebcb7
Commit
c51ebcb7
authored
7 years ago
by
SmallJoker
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Carts: Do not connect rails with gunpowder (#1812)
parent
bae17cd8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mods/carts/cart_entity.lua
+2
-2
2 additions, 2 deletions
mods/carts/cart_entity.lua
mods/carts/functions.lua
+6
-1
6 additions, 1 deletion
mods/carts/functions.lua
with
8 additions
and
3 deletions
mods/carts/cart_entity.lua
+
2
−
2
View file @
c51ebcb7
...
...
@@ -58,7 +58,8 @@ end
function
cart_entity
:
on_punch
(
puncher
,
time_from_last_punch
,
tool_capabilities
,
direction
)
local
pos
=
self
.
object
:
getpos
()
if
not
self
.
railtype
then
local
vel
=
self
.
object
:
getvelocity
()
if
not
self
.
railtype
or
vector
.
equals
(
vel
,
{
x
=
0
,
y
=
0
,
z
=
0
})
then
local
node
=
minetest
.
get_node
(
pos
).
name
self
.
railtype
=
minetest
.
get_item_group
(
node
,
"connect_to_raillike"
)
end
...
...
@@ -105,7 +106,6 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities,
return
end
-- Player punches cart to alter velocity
local
vel
=
self
.
object
:
getvelocity
()
if
puncher
:
get_player_name
()
==
self
.
driver
then
if
math.abs
(
vel
.
x
+
vel
.
z
)
>
carts
.
punch_speed_max
then
return
...
...
This diff is collapsed.
Click to expand it.
mods/carts/functions.lua
+
6
−
1
View file @
c51ebcb7
...
...
@@ -211,7 +211,12 @@ end
function
carts
:
get_rail_groups
(
additional_groups
)
-- Get the default rail groups and add more when a table is given
local
groups
=
{
dig_immediate
=
2
,
attached_node
=
1
,
rail
=
1
,
connect_to_raillike
=
1
}
local
groups
=
{
dig_immediate
=
2
,
attached_node
=
1
,
rail
=
1
,
connect_to_raillike
=
minetest
.
raillike_group
(
"rail"
)
}
if
type
(
additional_groups
)
==
"table"
then
for
k
,
v
in
pairs
(
additional_groups
)
do
groups
[
k
]
=
v
...
...
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