Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mesecons
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
mesecons
Commits
b6ae419b
Commit
b6ae419b
authored
10 years ago
by
Jeija
Browse files
Options
Downloads
Patches
Plain Diff
Return if invalid parameters are given to node_detector_scan (e.g. unloaded area), should fix #228
parent
a6d0a523
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mesecons_detector/init.lua
+6
-2
6 additions, 2 deletions
mesecons_detector/init.lua
with
6 additions
and
2 deletions
mesecons_detector/init.lua
+
6
−
2
View file @
b6ae419b
...
...
@@ -135,8 +135,12 @@ end
-- returns true if player was found, false if not
local
node_detector_scan
=
function
(
pos
)
local
node
=
minetest
.
get_node
(
pos
)
local
frontpos
=
vector
.
subtract
(
pos
,
minetest
.
facedir_to_dir
(
node
.
param2
))
if
not
pos
then
return
end
local
node
=
minetest
.
get_node_or_nil
(
pos
)
if
not
node
then
return
end
local
scandir
=
minetest
.
facedir_to_dir
(
node
.
param2
)
if
not
scandir
then
return
end
local
frontpos
=
vector
.
subtract
(
pos
,
scandir
)
local
frontnode
=
minetest
.
get_node
(
frontpos
)
local
meta
=
minetest
.
get_meta
(
pos
)
return
(
frontnode
.
name
==
meta
:
get_string
(
"scanname"
))
or
...
...
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