mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-06 08:18:13 +07:00
Bugfixes
This commit is contained in:
@ -272,7 +272,7 @@ public class EntityProcess extends BaseProcessor{
|
||||
err("Type " + type + " has multiple components implementing non-void method " + entry.key + ".");
|
||||
}
|
||||
|
||||
entry.value.sort(m -> m.has(MethodPriority.class) ? m.annotation(MethodPriority.class).value() : 0);
|
||||
entry.value.sort(Structs.comps(Structs.comparingFloat(m -> m.has(MethodPriority.class) ? m.annotation(MethodPriority.class).value() : 0), Structs.comparing(Selement::name)));
|
||||
|
||||
//representative method
|
||||
Smethod first = entry.value.first();
|
||||
|
@ -269,6 +269,7 @@ public class Blocks implements ContentList{
|
||||
|
||||
ice = new Floor("ice"){{
|
||||
dragMultiplier = 0.35f;
|
||||
speedMultiplier = 0.9f;
|
||||
attributes.set(Attribute.water, 0.4f);
|
||||
}};
|
||||
|
||||
|
@ -115,8 +115,7 @@ public class EntityCollisions{
|
||||
tree.clear();
|
||||
|
||||
group.each(s -> {
|
||||
s.lastX(s.getX());
|
||||
s.lastY(s.getY());
|
||||
s.updateLastPosition();
|
||||
tree.insert(s);
|
||||
});
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ abstract class EntityComp{
|
||||
return added;
|
||||
}
|
||||
|
||||
void init(){}
|
||||
|
||||
void update(){}
|
||||
|
||||
void remove(){
|
||||
|
@ -32,7 +32,6 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
||||
}
|
||||
|
||||
void moveAt(Vec2 vector){
|
||||
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();
|
||||
Vec2 t = Tmp.v3.set(vector).scl(floorSpeedMultiplier()); //target vector
|
||||
float mag = Tmp.v3.len();
|
||||
vel.x = Mathf.approach(vel.x, t.x, mag);
|
||||
|
@ -13,10 +13,9 @@ abstract class LegsComp implements Posc, Flyingc, Hitboxc, DrawLayerGroundUnderc
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
if(vel().len() > 0.5f){
|
||||
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed);
|
||||
walkTime += Time.delta()*vel().len()/1f;
|
||||
}
|
||||
float len = vel().len();
|
||||
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
|
||||
walkTime += Time.delta()*len/1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,6 +12,8 @@ abstract class VelComp implements Posc{
|
||||
final Vec2 vel = new Vec2();
|
||||
float drag = 0f;
|
||||
|
||||
//velocity needs to be called first, as it affects delta and lastPosition
|
||||
@MethodPriority(-1)
|
||||
@Override
|
||||
public void update(){
|
||||
move(vel.x, vel.y);
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=0328073f1993cd1d72a237781c3cc1f82395234b
|
||||
archash=68b2451bd0f8c6252ccf2c065a1c4b4896605183
|
||||
|
Reference in New Issue
Block a user