mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 11:17:11 +07:00
Fixed unit legs not resetting properly
This commit is contained in:
parent
5ce95d7fc7
commit
25e82d927f
@ -74,7 +74,6 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
|
||||
tree = new FileTree();
|
||||
assets.setLoader(Sound.class, new SoundLoader(tree){
|
||||
|
||||
@Override
|
||||
public void loadAsync(AssetManager manager, String fileName, Fi file, SoundParameter parameter){
|
||||
|
||||
@ -109,7 +108,6 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
|
||||
@Override
|
||||
public Music loadSync(AssetManager manager, String fileName, Fi file, MusicParameter parameter){
|
||||
|
||||
if(parameter != null && parameter.music != null){
|
||||
mainExecutor.submit(() -> {
|
||||
try{
|
||||
|
@ -202,8 +202,8 @@ public class SectorPresets{
|
||||
|
||||
rules = r -> {
|
||||
r.objectives.addAll(
|
||||
new BuildCountObjective(Blocks.shipFabricator, 1),
|
||||
new UnitCountObjective(UnitTypes.elude, 1)
|
||||
new BuildCountObjective(Blocks.shipFabricator, 1),
|
||||
new UnitCountObjective(UnitTypes.elude, 1)
|
||||
);
|
||||
};
|
||||
}};
|
||||
|
@ -89,16 +89,19 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
||||
resetLegs(type.legLength);
|
||||
}
|
||||
|
||||
//TODO clearly broken for many units
|
||||
public void resetLegs(float legLength){
|
||||
int count = type.legCount;
|
||||
|
||||
this.legs = new Leg[count];
|
||||
|
||||
if(type.lockLegBase){
|
||||
baseRotation = rotation;
|
||||
}
|
||||
|
||||
for(int i = 0; i < legs.length; i++){
|
||||
Leg l = new Leg();
|
||||
|
||||
float dstRot = legAngle(i) + (type.lockLegBase ? rotation - baseRotation : baseRotation);
|
||||
float dstRot = legAngle(i);
|
||||
Vec2 baseOffset = legOffset(Tmp.v5, i).add(x, y);
|
||||
|
||||
l.joint.trns(dstRot, legLength/2f).add(baseOffset);
|
||||
|
Loading…
Reference in New Issue
Block a user