Many misc bugfixes
This commit is contained in:
@@ -444,7 +444,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
if(trail != null){
|
if(trail != null){
|
||||||
trail.length = type.trailLength;
|
trail.length = type.trailLength;
|
||||||
|
|
||||||
float scale = elevation();
|
float scale = elevation;
|
||||||
float offset = type.engineOffset/2f + type.engineOffset/2f*scale;
|
float offset = type.engineOffset/2f + type.engineOffset/2f*scale;
|
||||||
|
|
||||||
float cx = x + Angles.trnsx(rotation + 180, offset), cy = y + Angles.trnsy(rotation + 180, offset);
|
float cx = x + Angles.trnsx(rotation + 180, offset), cy = y + Angles.trnsy(rotation + 180, offset);
|
||||||
|
|||||||
@@ -329,6 +329,7 @@ public class Teams{
|
|||||||
|
|
||||||
for(var build : builds){
|
for(var build : builds){
|
||||||
if(build.within(x, y, range) && !cores.contains(c -> c.within(x, y, range))){
|
if(build.within(x, y, range) && !cores.contains(c -> c.within(x, y, range))){
|
||||||
|
//TODO GPU driver bugs?
|
||||||
build.kill();
|
build.kill();
|
||||||
//Time.run(Mathf.random(0f, 60f * 6f), build::kill);
|
//Time.run(Mathf.random(0f, 60f * 6f), build::kill);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,11 +261,22 @@ public class MinimapRenderer{
|
|||||||
if(tile.build != null && tile.isCenter()){
|
if(tile.build != null && tile.isCenter()){
|
||||||
tile.getLinkedTiles(other -> {
|
tile.getLinkedTiles(other -> {
|
||||||
if(!other.isCenter()){
|
if(!other.isCenter()){
|
||||||
update(other);
|
updatePixel(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tile.block().solid && other.y > 0){
|
||||||
|
Tile low = world.tile(other.x, other.y - 1);
|
||||||
|
if(!low.solid()){
|
||||||
|
updatePixel(low);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updatePixel(tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
void updatePixel(Tile tile){
|
||||||
int color = colorFor(tile);
|
int color = colorFor(tile);
|
||||||
pixmap.set(tile.x, pixmap.height - 1 - tile.y, color);
|
pixmap.set(tile.x, pixmap.height - 1 - tile.y, color);
|
||||||
|
|
||||||
@@ -285,7 +296,7 @@ public class MinimapRenderer{
|
|||||||
|
|
||||||
private Block realBlock(Tile tile){
|
private Block realBlock(Tile tile){
|
||||||
//TODO doesn't work properly until player goes and looks at block
|
//TODO doesn't work properly until player goes and looks at block
|
||||||
return tile.build == null ? tile.block() : state.rules.fog && tile.build.inFogTo(player.team()) ? Blocks.air : tile.block();
|
return tile.build == null ? tile.block() : state.rules.fog && !tile.build.wasVisible ? Blocks.air : tile.block();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int colorFor(Tile tile){
|
private int colorFor(Tile tile){
|
||||||
|
|||||||
@@ -143,9 +143,11 @@ public class UnitPayload implements Payload{
|
|||||||
|
|
||||||
//TODO this would be more accurate but has all sorts of associated problems (?)
|
//TODO this would be more accurate but has all sorts of associated problems (?)
|
||||||
if(true){
|
if(true){
|
||||||
|
float e = unit.elevation;
|
||||||
unit.elevation = 0f;
|
unit.elevation = 0f;
|
||||||
//avoids drawing mining or building
|
//avoids drawing mining or building
|
||||||
unit.type.draw(unit);
|
unit.type.draw(unit);
|
||||||
|
unit.elevation = e;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user