mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
* 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:
parent
ae6be1db3b
commit
e4ecfc4ee7
@ -119,6 +119,7 @@ public class Placement{
|
||||
|
||||
var result = plans1.clear();
|
||||
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:
|
||||
for(int i = 0; i < plans.size;){
|
||||
@ -144,7 +145,11 @@ public class Placement{
|
||||
//found a link, assign bridges
|
||||
cur.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;
|
||||
continue outer;
|
||||
|
Loading…
Reference in New Issue
Block a user