Implemented alloy smelter, fixed place crashes for many of the blocks
This commit is contained in:
@@ -7,7 +7,6 @@ import com.badlogic.gdx.graphics.OrthographicCamera;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Layer;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.world.blocks.types.StaticBlock;
|
||||
@@ -125,7 +124,7 @@ public class BlockRenderer{
|
||||
|
||||
for(; iterateidx < requestidx; iterateidx ++){
|
||||
|
||||
if(iterateidx < requests.size - 1 && requests.get(iterateidx).layer.ordinal() > stopAt.ordinal()){
|
||||
if(iterateidx < requests.size && requests.get(iterateidx).layer.ordinal() > stopAt.ordinal()){
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -143,15 +142,15 @@ public class BlockRenderer{
|
||||
}
|
||||
|
||||
public void drawTeamBlocks(Layer layer, Team team){
|
||||
int iterateidx = this.iterateidx;
|
||||
int index = this.iterateidx;
|
||||
|
||||
for(; iterateidx < requestidx; iterateidx ++){
|
||||
for(; index < requestidx; index ++){
|
||||
|
||||
if(iterateidx < requests.size - 1 && requests.get(iterateidx).layer.ordinal() > layer.ordinal()){
|
||||
if(index < requests.size && requests.get(index).layer.ordinal() > layer.ordinal()){
|
||||
break;
|
||||
}
|
||||
|
||||
BlockRequest req = requests.get(iterateidx);
|
||||
BlockRequest req = requests.get(index);
|
||||
if(req.tile.getTeam() != team) continue;
|
||||
Block block = req.tile.block();
|
||||
|
||||
@@ -166,7 +165,7 @@ public class BlockRenderer{
|
||||
public void skipLayer(Layer stopAt){
|
||||
|
||||
for(; iterateidx < requestidx; iterateidx ++){
|
||||
if(iterateidx < requests.size - 1 && requests.get(iterateidx).layer.ordinal() > stopAt.ordinal()){
|
||||
if(iterateidx < requests.size && requests.get(iterateidx).layer.ordinal() > stopAt.ordinal()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,6 +211,14 @@ public class Fx{
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
|
||||
smeltsmoke = new Effect(15, e -> {
|
||||
Angles.randLenVectors(e.id, 6, 4f + e.ifract()*5f, (x, y)->{
|
||||
Draw.color(Color.WHITE, Color.valueOf("ffc999"), e.ifract());
|
||||
Fill.poly(e.x + x, e.y + y, 4, 0.5f+e.fract()*2f, 45);
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
|
||||
blastsmoke = new Effect(26, e -> {
|
||||
Angles.randLenVectors(e.id, 12, 1f + e.ifract()*23f, (x, y)->{
|
||||
|
||||
14
core/src/io/anuke/mindustry/graphics/Layer.java
Normal file
14
core/src/io/anuke/mindustry/graphics/Layer.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package io.anuke.mindustry.graphics;
|
||||
|
||||
public enum Layer{
|
||||
/**Base block layer.*/
|
||||
block,
|
||||
/**First overlay. Stuff like conveyor items.*/
|
||||
overlay,
|
||||
/**"High" blocks, like turrets.*/
|
||||
turret,
|
||||
/**Power lasers.*/
|
||||
power,
|
||||
/**Extra lasers, like healing turrets.*/
|
||||
laser;
|
||||
}
|
||||
Reference in New Issue
Block a user