Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Apr 6, 2024
2 parents 33f0111 + 58d6b3e commit f093f94
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
26 changes: 19 additions & 7 deletions core/src/mindustry/entities/comp/ChildComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.gen.*;
import mindustry.world.blocks.defense.turrets.BaseTurret.*;

@Component
abstract class ChildComp implements Posc, Rotc{
Expand All @@ -18,20 +19,31 @@ public void add(){
if(parent != null){
offsetX = x - parent.getX();
offsetY = y - parent.getY();
if(rotWithParent && parent instanceof Rotc r){
offsetPos = -r.rotation();
offsetRot = rotation - r.rotation();
if(rotWithParent){
if(parent instanceof Rotc r){
offsetPos = -r.rotation();
offsetRot = rotation - r.rotation();
}else if(parent instanceof BaseTurretBuild build){
offsetPos = -build.rotation;
offsetRot = rotation - build.rotation;
}
}
}
}

@Override
public void update(){
if(parent != null){
if(rotWithParent && parent instanceof Rotc r){
x = parent.getX() + Angles.trnsx(r.rotation() + offsetPos, offsetX, offsetY);
y = parent.getY() + Angles.trnsy(r.rotation() + offsetPos, offsetX, offsetY);
rotation = r.rotation() + offsetRot;
if(rotWithParent){
if(parent instanceof Rotc r){
x = parent.getX() + Angles.trnsx(r.rotation() + offsetPos, offsetX, offsetY);
y = parent.getY() + Angles.trnsy(r.rotation() + offsetPos, offsetX, offsetY);
rotation = r.rotation() + offsetRot;
}else if(parent instanceof BaseTurretBuild build){
x = parent.getX() + Angles.trnsx(build.rotation + offsetPos, offsetX, offsetY);
y = parent.getY() + Angles.trnsy(build.rotation + offsetPos, offsetX, offsetY);
rotation = build.rotation + offsetRot;
}
}else{
x = parent.getX() + offsetX;
y = parent.getY() + offsetY;
Expand Down
6 changes: 3 additions & 3 deletions servers_v7.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"address": ["cn1.meiqiumdt.top","cn1.meiqiumdt.top:7000","cn1.meiqiumdt.top:8000","cn1.meiqiumdt.top:7013","cn1.meiqiumdt.top:9000"]
},
{
"name": "Crux's Revelations",
"address": ["de-free-01.hosts.optikservers.com:31528","de-prem-01.hosts.optikservers.com:35922"]
"name": "Crux's Citadel",
"address": ["45.158.9.198:32865","45.158.9.198:30055","45.158.9.198:32175","45.158.9.198:30252","94.130.132.149:35899","129.154.47.57:26645","94.130.132.149:35930","129.154.47.57:27993","129.154.47.57:26881"]
},
{
"name": "Chilldustry",
Expand Down Expand Up @@ -291,7 +291,7 @@
},
{
"name": "NPTS",
"address": ["94.198.54.132:26863"]
"address": ["81.94.156.54"]
},
{
"name": "Skywar.VN",
Expand Down

0 comments on commit f093f94

Please sign in to comment.