bubba2251 / freerct

Automatically exported from code.google.com/p/freerct
0 stars 0 forks source link

Path building height offset problem #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build path as in picture

What is the expected output? What do you see instead?
Height offsets do not seem to get 'lowered' with the path correctly. Same 
problem can also be triggered differently with another path below.

Original issue reported on code.google.com by CharlesP...@googlemail.com on 25 Sep 2013 at 11:42

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by CharlesP...@googlemail.com on 25 Sep 2013 at 11:47

GoogleCodeExporter commented 9 years ago

Original comment by CharlesP...@googlemail.com on 25 Sep 2013 at 7:34

GoogleCodeExporter commented 9 years ago
The following patch appears to fix the problem:

Index: src/path_build.cpp
===================================================================
--- src/path_build.cpp  (revision 960)
+++ src/path_build.cpp  (working copy)
@@ -521,14 +521,14 @@
    if (this->state <= PBS_WAIT_ARROW || this->state > PBS_WAIT_BUY || edge == INVALID_EDGE) return;

    /* First try to find a voxel with a path at it. */
+   if (!move_up && this->TryMove(edge, -1, true)) return;
    if (this->TryMove(edge, 0, true)) return;
    if ( move_up && this->TryMove(edge,  1, true)) return;
-   if (!move_up && this->TryMove(edge, -1, true)) return;

    /* Otherwise just settle for a surface. */
+   if (!move_up && this->TryMove(edge, -1, false)) return;
    if (this->TryMove(edge, 0, false)) return;
    if ( move_up && this->TryMove(edge,  1, false)) return;
-   if (!move_up && this->TryMove(edge, -1, false)) return;
 }

 /**

However, I'm not sure if this is the correct way to fix this, as it seems to me 
that the selection box may want to be over the piece that hasn;t been added 
yet, rather than the 'root' piece

Original comment by CharlesP...@googlemail.com on 3 Dec 2013 at 11:49

GoogleCodeExporter commented 9 years ago

Original comment by CharlesP...@googlemail.com on 5 Dec 2013 at 12:30