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
cf568a5f
Commit
cf568a5f
authored
Jan 17, 2022
by
Peter Nerlich
Browse files
Options
Downloads
Patches
Plain Diff
only consider 45deg turns instead of 90deg
parent
4b2e5416
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
train.lua
+2
-2
2 additions, 2 deletions
train.lua
with
2 additions
and
2 deletions
train.lua
+
2
−
2
View file @
cf568a5f
...
@@ -548,11 +548,11 @@ recalculate_line_to = function(pos_a, pos_b, meta_a, meta_b)
...
@@ -548,11 +548,11 @@ recalculate_line_to = function(pos_a, pos_b, meta_a, meta_b)
else
else
local
inconn
=
next_conns
[
adj_connid
]
local
inconn
=
next_conns
[
adj_connid
]
-- query the next conns
-- query the next conns
local
quarter
=
AT_CMAX
/
4
local
deg45
=
AT_CMAX
/
8
for
nconnid
,
nconn
in
ipairs
(
next_conns
)
do
for
nconnid
,
nconn
in
ipairs
(
next_conns
)
do
local
normed
=
(
nconn
.
c
-
inconn
.
c
)
%
AT_CMAX
local
normed
=
(
nconn
.
c
-
inconn
.
c
)
%
AT_CMAX
-- only accept conns that turn 90deg at most
-- only accept conns that turn 90deg at most
if
normed
>=
quarter
and
normed
<=
quarter
*
3
then
if
normed
>=
deg45
and
normed
<=
AT_CMAX
-
deg45
then
local
line
=
clone
(
min_item
.
line
)
local
line
=
clone
(
min_item
.
line
)
if
nconn
.
c
~=
inconn
.
c
then
if
nconn
.
c
~=
inconn
.
c
then
table.insert
(
line
,
minetest
.
pos_to_string
(
adj_pos
))
table.insert
(
line
,
minetest
.
pos_to_string
(
adj_pos
))
...
...
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