* Fixed #4719 since it is 100% a bug This fix is somewhat janky as it checks if the rotation matches the exact original rotation but the likelihood of someone needing bridges along a belt rotated 1 or -1 times is super low. https://aethex.is-a.fail/t13ETd.webm * unjank rotation * fix potential crash, styling * Use mathf.mod
This commit is contained in:
@@ -119,6 +119,7 @@ public class Placement{
|
|||||||
|
|
||||||
var result = plans1.clear();
|
var result = plans1.clear();
|
||||||
var team = player.team();
|
var team = player.team();
|
||||||
|
var rotated = plans.first().tile() != null && plans.first().tile().absoluteRelativeTo(plans.peek().x, plans.peek().y) == Mathf.mod(plans.first().rotation + 2, 4);
|
||||||
|
|
||||||
outer:
|
outer:
|
||||||
for(int i = 0; i < plans.size;){
|
for(int i = 0; i < plans.size;){
|
||||||
@@ -144,7 +145,11 @@ public class Placement{
|
|||||||
//found a link, assign bridges
|
//found a link, assign bridges
|
||||||
cur.block = bridge;
|
cur.block = bridge;
|
||||||
other.block = bridge;
|
other.block = bridge;
|
||||||
cur.config = new Point2(other.x - cur.x, other.y - cur.y);
|
if(rotated){
|
||||||
|
other.config = new Point2(cur.x - other.x, cur.y - other.y);
|
||||||
|
}else{
|
||||||
|
cur.config = new Point2(other.x - cur.x, other.y - cur.y);
|
||||||
|
}
|
||||||
|
|
||||||
i = j;
|
i = j;
|
||||||
continue outer;
|
continue outer;
|
||||||
|
|||||||
Reference in New Issue
Block a user