mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-13 19:39:04 +07:00
Fixed some multithreading bugs / No more drift
This commit is contained in:
parent
1651844b4f
commit
62f2c67321
@ -27,7 +27,7 @@ allprojects {
|
||||
appName = 'Mindustry'
|
||||
gdxVersion = '1.9.8'
|
||||
roboVMVersion = '2.3.0'
|
||||
uCoreVersion = 'd4c099a41403659e2c35cfd05ae79b610b9c3ae5'
|
||||
uCoreVersion = '7aa05daa277ffb67cda3d2d047c37b2f441e4e4e'
|
||||
|
||||
getVersionString = {
|
||||
String buildVersion = getBuildVersion()
|
||||
|
@ -83,7 +83,7 @@ public class Pathfinder{
|
||||
}
|
||||
|
||||
public float getValueforTeam(Team team, int x, int y){
|
||||
return paths == null ? 0 : paths[team.ordinal()].weights[x][y];
|
||||
return paths == null || team.ordinal() >= paths.length ? 0 : paths[team.ordinal()].weights[x][y];
|
||||
}
|
||||
|
||||
private boolean passable(Tile tile, Team team){
|
||||
|
@ -134,6 +134,7 @@ public class Logic extends Module{
|
||||
for(EntityGroup group : unitGroups){
|
||||
Entities.update(group);
|
||||
}
|
||||
|
||||
Entities.update(puddleGroup);
|
||||
Entities.update(tileGroup);
|
||||
Entities.update(shieldGroup);
|
||||
|
@ -641,7 +641,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
|
||||
if(velocity.len() <= 0.2f){
|
||||
rotation += Mathf.sin(Timers.time() + id * 99, 10f, 1f);
|
||||
}else{
|
||||
}else if(target == null){
|
||||
rotation = Mathf.slerpDelta(rotation, velocity.angle(), velocity.len() / 10f);
|
||||
}
|
||||
|
||||
|
@ -12,10 +12,7 @@ import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.meta.BlockFlag;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Geometry;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
import io.anuke.ucore.util.Translator;
|
||||
import io.anuke.ucore.util.*;
|
||||
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
@ -182,11 +179,11 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
|
||||
protected void wobble(){
|
||||
if(Net.client()) return;
|
||||
|
||||
x += Mathf.sin(Timers.time() + id * 999, 25f, 0.07f);
|
||||
y += Mathf.cos(Timers.time() + id * 999, 25f, 0.07f);
|
||||
x += Mathf.sin(Timers.time() + id * 999, 25f, 0.07f)*Timers.delta();
|
||||
y += Mathf.cos(Timers.time() + id * 999, 25f, 0.07f)*Timers.delta();
|
||||
|
||||
if(velocity.len() <= 0.2f){
|
||||
rotation += Mathf.sin(Timers.time() + id * 99, 10f, 8f);
|
||||
if(velocity.len() <= 0.05f){
|
||||
rotation += Mathf.sin(Timers.time() + id * 99, 10f, 5f)*Timers.delta();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -346,9 +346,6 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
||||
entity.health = Mathf.clamp(entity.health, 0, entity.tile.block().health);
|
||||
}
|
||||
|
||||
x += Mathf.sin(Timers.time() + id * 999, 25f, 0.07f);
|
||||
y += Mathf.cos(Timers.time() + id * 999, 25f, 0.07f);
|
||||
|
||||
updateBuilding(this);
|
||||
}
|
||||
|
||||
@ -359,10 +356,6 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
||||
}else{
|
||||
rotation = Mathf.slerpDelta(rotation, velocity.angle(), 0.3f);
|
||||
}
|
||||
|
||||
if(velocity.len() <= 0.2f && !(state.is(repair) && target != null)){
|
||||
rotation += Mathf.sin(Timers.time() + id * 99, 10f, 5f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,7 +62,7 @@ public class CoreBlock extends StorageBlock{
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void onUnitRespawn(Tile tile, Unit player){
|
||||
if(player == null) return;
|
||||
if(player == null || tile.entity == null) return;
|
||||
|
||||
CoreEntity entity = tile.entity();
|
||||
Effects.effect(Fx.spawn, entity);
|
||||
|
@ -25,7 +25,6 @@ import io.anuke.mindustry.world.meta.StatUnit;
|
||||
import io.anuke.mindustry.world.modules.InventoryModule;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Lines;
|
||||
import io.anuke.ucore.util.EnumSet;
|
||||
@ -59,6 +58,8 @@ public class UnitPad extends Block{
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void onUnitFactorySpawn(Tile tile){
|
||||
if(!(tile.entity instanceof UnitFactoryEntity) || !(tile.block() instanceof UnitPad)) return;
|
||||
|
||||
UnitFactoryEntity entity = tile.entity();
|
||||
UnitPad factory = (UnitPad) tile.block();
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
package io.anuke.mindustry.world.blocks.units;
|
||||
|
||||
public class UnloadPoint{
|
||||
}
|
Loading…
Reference in New Issue
Block a user