Bugfixes
This commit is contained in:
@@ -4,8 +4,7 @@ import io.anuke.arc.Core;
|
|||||||
import io.anuke.arc.collection.IntArray;
|
import io.anuke.arc.collection.IntArray;
|
||||||
import io.anuke.arc.function.IntPositionConsumer;
|
import io.anuke.arc.function.IntPositionConsumer;
|
||||||
import io.anuke.arc.input.KeyCode;
|
import io.anuke.arc.input.KeyCode;
|
||||||
import io.anuke.arc.util.Pack;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.util.Structs;
|
|
||||||
import io.anuke.mindustry.content.Blocks;
|
import io.anuke.mindustry.content.Blocks;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
@@ -143,7 +142,6 @@ public enum EditorTool{
|
|||||||
}else{
|
}else{
|
||||||
//normal fill
|
//normal fill
|
||||||
int x1;
|
int x1;
|
||||||
boolean spanAbove, spanBelow;
|
|
||||||
|
|
||||||
stack.clear();
|
stack.clear();
|
||||||
|
|
||||||
@@ -157,21 +155,21 @@ public enum EditorTool{
|
|||||||
x1 = x;
|
x1 = x;
|
||||||
while(x1 >= 0 && eq(x1, y)) x1--;
|
while(x1 >= 0 && eq(x1, y)) x1--;
|
||||||
x1++;
|
x1++;
|
||||||
spanAbove = spanBelow = false;
|
boolean spanAbove = false, spanBelow = false;
|
||||||
while(x1 < width && eq(x1, y)){
|
while(x1 < width && eq(x1, y)){
|
||||||
writer.accept(x1, y);
|
writer.accept(x1, y);
|
||||||
|
|
||||||
if(!spanAbove && y > 0 && eq(x1, y - 1)){
|
if(!spanAbove && y > 0 && eq(x1, y - 1)){
|
||||||
stack.add(Pos.get(x1, y - 1));
|
stack.add(Pos.get(x1, y - 1));
|
||||||
spanAbove = true;
|
spanAbove = true;
|
||||||
}else if(spanAbove && eq(x1, y - 1)){
|
}else if(spanAbove && !eq(x1, y - 1)){
|
||||||
spanAbove = false;
|
spanAbove = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!spanBelow && y < height - 1 && eq(x1, y + 1)){
|
if(!spanBelow && y < height - 1 && eq(x1, y + 1)){
|
||||||
stack.add(Pos.get(x1, y + 1));
|
stack.add(Pos.get(x1, y + 1));
|
||||||
spanBelow = true;
|
spanBelow = true;
|
||||||
}else if(spanBelow && y < height - 1 && eq(x1, y + 1)){
|
}else if(spanBelow && y < height - 1 && !eq(x1, y + 1)){
|
||||||
spanBelow = false;
|
spanBelow = false;
|
||||||
}
|
}
|
||||||
x1++;
|
x1++;
|
||||||
|
|||||||
@@ -243,7 +243,6 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
Events.fire(new BlockDestroyEvent(tile));
|
Events.fire(new BlockDestroyEvent(tile));
|
||||||
block.onDestroyed(tile);
|
block.onDestroyed(tile);
|
||||||
world.removeBlock(tile);
|
world.removeBlock(tile);
|
||||||
block.afterDestroyed(tile, this);
|
|
||||||
remove();
|
remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,11 +194,11 @@ public class BlockRenderer implements Disposable{
|
|||||||
|
|
||||||
if(block.expanded || !expanded){
|
if(block.expanded || !expanded){
|
||||||
|
|
||||||
if(block.layer != null && block.isLayer(tile)){
|
if(block.layer != null){
|
||||||
addRequest(tile, block.layer);
|
addRequest(tile, block.layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(block.layer2 != null && block.isLayer2(tile)){
|
if(block.layer2 != null){
|
||||||
addRequest(tile, block.layer2);
|
addRequest(tile, block.layer2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -192,14 +192,6 @@ public class Block extends BlockStorage{
|
|||||||
return progressIncrease;
|
return progressIncrease;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLayer(Tile tile){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isLayer2(Tile tile){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void drawLayer(Tile tile){
|
public void drawLayer(Tile tile){
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,7 +266,6 @@ public class Block extends BlockStorage{
|
|||||||
|
|
||||||
/** Called when a unit that spawned at this tile is removed. */
|
/** Called when a unit that spawned at this tile is removed. */
|
||||||
public void unitRemoved(Tile tile, Unit unit){
|
public void unitRemoved(Tile tile, Unit unit){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns whether ot not this block can be place on the specified tile. */
|
/** Returns whether ot not this block can be place on the specified tile. */
|
||||||
@@ -476,11 +467,6 @@ public class Block extends BlockStorage{
|
|||||||
return (hasItems && itemCapacity > 0);
|
return (hasItems && itemCapacity > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called after the block is destroyed and removed. */
|
|
||||||
public void afterDestroyed(Tile tile, TileEntity entity){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Called when the block is destroyed. */
|
/** Called when the block is destroyed. */
|
||||||
public void onDestroyed(Tile tile){
|
public void onDestroyed(Tile tile){
|
||||||
float x = tile.worldx(), y = tile.worldy();
|
float x = tile.worldx(), y = tile.worldy();
|
||||||
|
|||||||
@@ -38,6 +38,15 @@ public class ItemTurret extends CooledTurret{
|
|||||||
stats.add(BlockStat.ammo, new AmmoListValue<>(ammo));
|
stats.add(BlockStat.ammo, new AmmoListValue<>(ammo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProximityAdded(Tile tile){
|
||||||
|
super.onProximityAdded(tile);
|
||||||
|
|
||||||
|
//add first ammo item to cheaty blocks so they can shoot properly
|
||||||
|
if(tile.isEnemyCheat() && ammo.size > 0){
|
||||||
|
handleItem(ammo.entries().next().key, tile, tile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void displayBars(Tile tile, Table bars){
|
public void displayBars(Tile tile, Table bars){
|
||||||
|
|||||||
Reference in New Issue
Block a user