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
e849d545
Unverified
Commit
e849d545
authored
4 years ago
by
sfan5
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
carts: Fix item collection (#2689)
parent
0662f962
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
mods/carts/cart_entity.lua
+4
-5
4 additions, 5 deletions
mods/carts/cart_entity.lua
with
4 additions
and
5 deletions
mods/carts/cart_entity.lua
+
4
−
5
View file @
e849d545
...
@@ -328,11 +328,10 @@ local function rail_on_step(self, dtime)
...
@@ -328,11 +328,10 @@ local function rail_on_step(self, dtime)
if
self
.
punched
then
if
self
.
punched
then
-- Collect dropped items
-- Collect dropped items
for
_
,
obj_
in
pairs
(
minetest
.
get_objects_inside_radius
(
pos
,
1
))
do
for
_
,
obj_
in
pairs
(
minetest
.
get_objects_inside_radius
(
pos
,
1
))
do
if
not
obj_
:
is_player
()
and
local
ent
=
obj_
:
get_luaentity
()
obj_
:
get_luaentity
()
and
-- Careful here: physical_state and disable_physics are item-internal APIs
not
obj_
:
get_luaentity
().
physical_state
and
if
ent
and
ent
.
name
==
"__builtin:item"
and
ent
.
physical_state
then
obj_
:
get_luaentity
().
name
==
"__builtin:item"
then
ent
:
disable_physics
()
obj_
:
set_attach
(
self
.
object
,
""
,
{
x
=
0
,
y
=
0
,
z
=
0
},
{
x
=
0
,
y
=
0
,
z
=
0
})
obj_
:
set_attach
(
self
.
object
,
""
,
{
x
=
0
,
y
=
0
,
z
=
0
},
{
x
=
0
,
y
=
0
,
z
=
0
})
self
.
attached_items
[
#
self
.
attached_items
+
1
]
=
obj_
self
.
attached_items
[
#
self
.
attached_items
+
1
]
=
obj_
end
end
...
...
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