Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mapserver_mod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Minetest
mapserver_mod
Commits
1859503c
Commit
1859503c
authored
4 years ago
by
BuckarooBanzay
Browse files
Options
Downloads
Patches
Plain Diff
load target area of teleport destination / teleport _above_ bones
fixes #8
parent
52b5c97f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bridge/search.lua
+10
-0
10 additions, 0 deletions
bridge/search.lua
with
10 additions
and
0 deletions
bridge/search.lua
+
10
−
0
View file @
1859503c
...
...
@@ -39,14 +39,24 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
if
fields
.
teleport
then
-- teleport player to selected item
if
not
minetest
.
check_player_privs
(
playername
,
"teleport"
)
then
minetest
.
chat_send_player
(
playername
,
"Missing priv: 'teleport'"
)
return
end
-- flat destination coordinates per default
local
pos1
=
vector
.
subtract
(
item
.
pos
,
{
x
=
2
,
y
=
0
,
z
=
2
})
local
pos2
=
vector
.
add
(
item
.
pos
,
{
x
=
2
,
y
=
0
,
z
=
2
})
if
item
.
type
==
"bones"
then
-- search for air _above_ the bones
pos1
=
vector
.
subtract
(
item
.
pos
,
{
x
=
0
,
y
=
0
,
z
=
0
})
pos2
=
vector
.
add
(
item
.
pos
,
{
x
=
0
,
y
=
10
,
z
=
0
})
end
-- forceload target coordinates before searching for air
minetest
.
get_voxel_manip
():
read_from_map
(
pos1
,
pos2
)
local
nodes
=
minetest
.
find_nodes_in_area
(
pos1
,
pos2
,
"air"
)
if
#
nodes
>
0
then
...
...
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