From e33c863162bd5cf65e0a0a14e86579ac2c314dd6 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 2 Dec 2018 16:56:44 -0500 Subject: [PATCH] Bugfixes --- core/assets/bundles/bundle.properties | 2 +- core/src/io/anuke/mindustry/ai/BlockIndexer.java | 4 ++-- core/src/io/anuke/mindustry/core/NetServer.java | 2 +- core/src/io/anuke/mindustry/entities/TileEntity.java | 4 ++++ .../mindustry/maps/missions/MissionWithStartingCore.java | 7 +++++++ core/src/io/anuke/mindustry/ui/dialogs/JoinDialog.java | 1 + .../anuke/mindustry/ui/fragments/PlayerListFragment.java | 2 +- 7 files changed, 17 insertions(+), 5 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 55a215f9cc..bff7ab1003 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -133,7 +133,7 @@ text.confirmunban = Are you sure you want to unban this player? text.confirmadmin = Are you sure you want to make this player an admin? text.confirmunadmin = Are you sure you want to remove admin status from this player? text.joingame.title = Join Game -text.joingame.ip = IP: +text.joingame.ip = Address: text.disconnect = Disconnected. text.disconnect.data = Failed to load world data! text.connecting = [accent]Connecting... diff --git a/core/src/io/anuke/mindustry/ai/BlockIndexer.java b/core/src/io/anuke/mindustry/ai/BlockIndexer.java index 6777c40d9c..8bc2d080d9 100644 --- a/core/src/io/anuke/mindustry/ai/BlockIndexer.java +++ b/core/src/io/anuke/mindustry/ai/BlockIndexer.java @@ -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 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); } } diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index 589d24f34e..eb019eca50 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -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; } diff --git a/core/src/io/anuke/mindustry/entities/TileEntity.java b/core/src/io/anuke/mindustry/entities/TileEntity.java index 10aec5f47b..7df1e6d659 100644 --- a/core/src/io/anuke/mindustry/entities/TileEntity.java +++ b/core/src/io/anuke/mindustry/entities/TileEntity.java @@ -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; } diff --git a/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java b/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java index 1dbb2b81a3..a134891329 100644 --- a/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java +++ b/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java @@ -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()); + } + } } /** diff --git a/core/src/io/anuke/mindustry/ui/dialogs/JoinDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/JoinDialog.java index 5e611b762f..c81c77e13b 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/JoinDialog.java @@ -268,6 +268,7 @@ public class JoinDialog extends FloatingDialog{ if(totalHosts == 0){ local.clear(); } + local.background((Drawable) null); totalHosts ++; float w = targetWidth(); diff --git a/core/src/io/anuke/mindustry/ui/fragments/PlayerListFragment.java b/core/src/io/anuke/mindustry/ui/fragments/PlayerListFragment.java index 03864af7ca..d9876ef1b3 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/PlayerListFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/PlayerListFragment.java @@ -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;