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
37710866
Commit
37710866
authored
5 years ago
by
sfan5
Browse files
Options
Downloads
Patches
Plain Diff
Switch dungeon type detection to biome name
see #2400, also removed a now unused alias
parent
bfb84da3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mods/default/mapgen.lua
+0
-1
0 additions, 1 deletion
mods/default/mapgen.lua
mods/dungeon_loot/mapgen.lua
+11
-12
11 additions, 12 deletions
mods/dungeon_loot/mapgen.lua
with
11 additions
and
13 deletions
mods/default/mapgen.lua
+
0
−
1
View file @
37710866
...
...
@@ -35,7 +35,6 @@ minetest.register_alias("mapgen_cobble", "default:cobble")
minetest
.
register_alias
(
"mapgen_stair_cobble"
,
"stairs:stair_cobble"
)
minetest
.
register_alias
(
"mapgen_mossycobble"
,
"default:mossycobble"
)
minetest
.
register_alias
(
"mapgen_stair_desert_stone"
,
"stairs:stair_desert_stone"
)
minetest
.
register_alias
(
"mapgen_sandstonebrick"
,
"default:sandstonebrick"
)
--
...
...
This diff is collapsed.
Click to expand it.
mods/dungeon_loot/mapgen.lua
+
11
−
12
View file @
37710866
...
...
@@ -15,12 +15,8 @@ local function random_sample(rand, list, count)
end
local
function
find_walls
(
cpos
)
local
wall
=
minetest
.
registered_aliases
[
"mapgen_cobble"
]
local
wall_alt
=
minetest
.
registered_aliases
[
"mapgen_mossycobble"
]
local
wall_ss
=
minetest
.
registered_aliases
[
"mapgen_sandstonebrick"
]
local
wall_ds
=
minetest
.
registered_aliases
[
"mapgen_desert_stone"
]
local
is_wall
=
function
(
node
)
return
table
.
indexof
({
wall
,
wall_alt
,
wall_ss
,
wall_ds
},
node
.
name
)
~=
-
1
return
node
.
name
~=
"air"
and
node
.
name
~=
"ignore"
end
local
dirs
=
{{
x
=
1
,
z
=
0
},
{
x
=-
1
,
z
=
0
},
{
x
=
0
,
z
=
1
},
{
x
=
0
,
z
=-
1
}}
...
...
@@ -29,7 +25,6 @@ local function find_walls(cpos)
local
ret
=
{}
local
mindist
=
{
x
=
0
,
z
=
0
}
local
min
=
function
(
a
,
b
)
return
a
~=
0
and
math.min
(
a
,
b
)
or
b
end
local
wallnode
for
_
,
dir
in
ipairs
(
dirs
)
do
for
i
=
1
,
9
do
-- 9 = max room size / 2
local
pos
=
vector
.
add
(
cpos
,
{
x
=
dir
.
x
*
i
,
y
=
0
,
z
=
dir
.
z
*
i
})
...
...
@@ -50,7 +45,6 @@ local function find_walls(cpos)
else
mindist
.
z
=
min
(
mindist
.
z
,
i
-
1
)
end
wallnode
=
node
.
name
end
-- abort even if it wasn't a wall cause something is in the way
break
...
...
@@ -58,14 +52,19 @@ local function find_walls(cpos)
end
end
local
mapping
=
{
[
wall_ss
]
=
"sandstone"
,
[
wall_ds
]
=
"desert"
}
local
biome
=
minetest
.
get_biome_data
(
cpos
)
local
biome
=
biome
and
minetest
.
get_biome_name
(
biome
.
biome
)
or
""
local
type
=
"normal"
if
biome
:
find
(
"desert"
)
==
1
then
type
=
"desert"
elseif
biome
:
find
(
"sandstone_desert"
)
==
1
then
type
=
"sandstone"
end
return
{
walls
=
ret
,
size
=
{
x
=
mindist
.
x
*
2
,
z
=
mindist
.
z
*
2
},
type
=
mapping
[
wallnode
]
or
"normal"
type
=
type
,
}
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