Skip to content

Commit

Permalink
Underground drill x-ray glitch possible fix x2
Browse files Browse the repository at this point in the history
  • Loading branch information
Slotterleet committed Aug 2, 2024
1 parent 2caa190 commit b162695
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/fos/type/blocks/production/UndergroundDrill.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public UndergroundDrill(String name){
super(name);
drillTime = 360f;
schematicPriority = -5; // build last to ensure ore detectors are built beforehand
drawMineItem = false;
}

//placeable on drill bases or replaceable by other underground drills
Expand All @@ -47,8 +48,6 @@ public boolean canPlaceOn(Tile tile, Team team, int rotation) {

@Override
public void drawPlace(int x, int y, int rotation, boolean valid) {
//super.drawPlace(x, y, rotation, valid);

Tile tile = world.tile(x, y);
var detector = nearestDetector(player.team(), x*8, y*8);
if (tile == null) return;
Expand Down Expand Up @@ -177,6 +176,16 @@ public void onProximityUpdate() {
if (dominantItem == Items.sand) dominantItems = (int)Mathf.sqr(size);
}

@Override
public void draw() {
super.draw();

//since drawMineItems is false, re-draw this thing
Draw.color(dominantItem.color);
Draw.rect(itemRegion, x, y);
Draw.color();
}

@Override
public float efficiencyScale() {
Ranged other = nearestDetector(team, x, y);
Expand Down

0 comments on commit b162695

Please sign in to comment.