This commit is contained in:
Anuken
2018-12-02 16:56:44 -05:00
parent 5afb5d24d8
commit e33c863162
7 changed files with 17 additions and 5 deletions

View File

@@ -86,7 +86,7 @@ public class BlockIndexer{
process(tile);
if(tile.entity != null && tile.entity.healthf() < 0.9999f){
if(tile.entity != null && tile.entity.damaged()){
notifyTileDamaged(tile.entity);
}
}
@@ -116,7 +116,7 @@ public class BlockIndexer{
ObjectSet<Tile> set = damagedTiles[team.ordinal()];
for(Tile tile : set){
if(tile.entity == null || tile.entity.getTeam() != team || tile.entity.healthf() >= 0.9999f){
if(tile.entity == null || tile.entity.getTeam() != team || !tile.entity.damaged()){
returnArray.add(tile);
}
}

View File

@@ -381,7 +381,7 @@ public class NetServer extends Module{
return;
}
if(other == null || (other.isAdmin && other != player)){ //fun fact: this means you can ban yourself
if(other == null || ((other.isAdmin && !player.isLocal) && other != player)){
Log.err("{0} attempted to perform admin action on nonexistant or admin player.", player.name);
return;
}

View File

@@ -154,6 +154,10 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
}
}
public boolean damaged(){
return health < maxHealth() - 0.00001f;
}
public Tile getTile(){
return tile;
}

View File

@@ -42,6 +42,13 @@ public abstract class MissionWithStartingCore extends Mission{
startingCoreTile.setBlock(StorageBlocks.core);
startingCoreTile.setTeam(team);
state.teams.get(team).cores.add(startingCoreTile);
//makes sure there's a flat area around core
for(int dx = -2; dx <= 2; dx++){
for(int dy = -2; dy <= 2; dy++){
gen.tiles[startingCoreTile.x + dx][startingCoreTile.y + dy].setElevation(startingCoreTile.getElevation());
}
}
}
/**

View File

@@ -268,6 +268,7 @@ public class JoinDialog extends FloatingDialog{
if(totalHosts == 0){
local.clear();
}
local.background((Drawable) null);
totalHosts ++;
float w = targetWidth();

View File

@@ -116,7 +116,7 @@ public class PlayerListFragment extends Fragment{
t.row();
t.addImageButton("icon-admin", "clear-toggle", 14 * 2, () -> {
t.addImageButton("icon-admin", "clear-toggle-partial", 14 * 2, () -> {
if(Net.client()) return;
String id = player.uuid;