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