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
Snippets
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
Zadrog Pzvotrügen
minetest_game
Commits
c76a9194
Commit
c76a9194
authored
9 years ago
by
ShadowNinja
Committed by
paramat
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix TNT drops being placed inside nodes
parent
0472e61a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mods/tnt/init.lua
+14
-2
14 additions, 2 deletions
mods/tnt/init.lua
with
14 additions
and
2 deletions
mods/tnt/init.lua
+
14
−
2
View file @
c76a9194
...
...
@@ -29,8 +29,20 @@ minetest.after(0, function()
end
)
local
function
rand_pos
(
center
,
pos
,
radius
)
pos
.
x
=
center
.
x
+
math.random
(
-
radius
,
radius
)
pos
.
z
=
center
.
z
+
math.random
(
-
radius
,
radius
)
local
def
local
reg_nodes
=
minetest
.
registered_nodes
local
i
=
0
repeat
-- Give up and use the center if this takes too long
if
i
>
4
then
pos
.
x
,
pos
.
z
=
center
.
x
,
center
.
z
break
end
pos
.
x
=
center
.
x
+
math.random
(
-
radius
,
radius
)
pos
.
z
=
center
.
z
+
math.random
(
-
radius
,
radius
)
def
=
reg_nodes
[
minetest
.
get_node
(
pos
).
name
]
i
=
i
+
1
until
def
and
not
def
.
walkable
end
local
function
eject_drops
(
drops
,
pos
,
radius
)
...
...
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