Many misc bugfixes

This commit is contained in:
Anuken 2022-04-26 10:13:33 -04:00
parent 8f5b3ee1e0
commit 42781bd754
4 changed files with 17 additions and 3 deletions

View File

@ -444,7 +444,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
if(trail != null){
trail.length = type.trailLength;
float scale = elevation();
float scale = elevation;
float offset = type.engineOffset/2f + type.engineOffset/2f*scale;
float cx = x + Angles.trnsx(rotation + 180, offset), cy = y + Angles.trnsy(rotation + 180, offset);

View File

@ -329,6 +329,7 @@ public class Teams{
for(var build : builds){
if(build.within(x, y, range) && !cores.contains(c -> c.within(x, y, range))){
//TODO GPU driver bugs?
build.kill();
//Time.run(Mathf.random(0f, 60f * 6f), build::kill);
}

View File

@ -261,11 +261,22 @@ public class MinimapRenderer{
if(tile.build != null && tile.isCenter()){
tile.getLinkedTiles(other -> {
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);
pixmap.set(tile.x, pixmap.height - 1 - tile.y, color);
@ -285,7 +296,7 @@ public class MinimapRenderer{
private Block realBlock(Tile tile){
//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){

View File

@ -143,9 +143,11 @@ public class UnitPayload implements Payload{
//TODO this would be more accurate but has all sorts of associated problems (?)
if(true){
float e = unit.elevation;
unit.elevation = 0f;
//avoids drawing mining or building
unit.type.draw(unit);
unit.elevation = e;
return;
}