From 4b36a6d5bd6c8ab392a6b956be322ce9c16825cb Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 29 Feb 2020 19:37:14 -0500 Subject: [PATCH] Bugfixes --- core/src/mindustry/core/Renderer.java | 12 +++++++++--- core/src/mindustry/core/World.java | 4 ++-- core/src/mindustry/entities/def/UnitComp.java | 2 +- core/src/mindustry/entities/def/WeaponsComp.java | 2 +- core/src/mindustry/game/Rules.java | 3 +++ core/src/mindustry/world/Build.java | 8 ++++---- gradle.properties | 2 +- 7 files changed, 21 insertions(+), 12 deletions(-) diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index aa31984d2d..7ac82478ab 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -6,7 +6,6 @@ import arc.graphics.*; import arc.graphics.g2d.*; import arc.graphics.gl.*; import arc.math.*; -import arc.math.geom.*; import arc.scene.ui.layout.*; import arc.util.*; import mindustry.content.*; @@ -33,7 +32,6 @@ public class Renderer implements ApplicationListener{ private float camerascale = targetscale; private float landscale = 0f, landTime; private float minZoomScl = Scl.scl(0.01f); - private Rect rect = new Rect(), rect2 = new Rect(); private float shakeIntensity, shaketime; public Renderer(){ @@ -169,6 +167,8 @@ public class Renderer implements ApplicationListener{ Draw.proj(camera.projection()); + drawBackground(); + blocks.floor.drawFloor(); Groups.drawFloor(); @@ -183,7 +183,9 @@ public class Renderer implements ApplicationListener{ blocks.floor.endDraw(); blocks.drawBlocks(Layer.block); - blocks.drawFog(); + if(state.rules.drawFog){ + blocks.drawFog(); + } blocks.drawDestroyed(); @@ -240,6 +242,10 @@ public class Renderer implements ApplicationListener{ Draw.flush(); } + private void drawBackground(){ + + } + private void drawLanding(){ if(landTime > 0 && player.closestCore() != null){ float fract = landTime / Fx.coreLand.lifetime; diff --git a/core/src/mindustry/core/World.java b/core/src/mindustry/core/World.java index 67ddfb2dee..9a963b3391 100644 --- a/core/src/mindustry/core/World.java +++ b/core/src/mindustry/core/World.java @@ -376,8 +376,8 @@ public class World{ } } - Tile tile = world.rawTile(x, y); - if(tile.block().solid && tile.block().fillsTile && !tile.block().synthetic()){ + Tile tile = world.tile(x, y); + if(tile != null && tile.block().solid && tile.block().fillsTile && !tile.block().synthetic()){ dark = Math.max(dark, tile.rotation()); } diff --git a/core/src/mindustry/entities/def/UnitComp.java b/core/src/mindustry/entities/def/UnitComp.java index e3e48350c5..23d2ce9af7 100644 --- a/core/src/mindustry/entities/def/UnitComp.java +++ b/core/src/mindustry/entities/def/UnitComp.java @@ -93,7 +93,7 @@ abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitbox } public void lookAt(float angle){ - rotation = Angles.moveToward(rotation, angle, type.rotateSpeed); + rotation = Angles.moveToward(rotation, angle, type.rotateSpeed * Time.delta()); } public void lookAt(Position pos){ diff --git a/core/src/mindustry/entities/def/WeaponsComp.java b/core/src/mindustry/entities/def/WeaponsComp.java index ccbb4edfea..9b9c5a7cd4 100644 --- a/core/src/mindustry/entities/def/WeaponsComp.java +++ b/core/src/mindustry/entities/def/WeaponsComp.java @@ -68,7 +68,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc{ axisY = this.y + Angles.trnsy(rotation, axisXOffset, weapon.y); mount.targetRotation = Angles.angle(axisX, axisY, mount.aimX, mount.aimY) - rotation(); - mount.rotation = Angles.moveToward(mount.rotation, mount.targetRotation, weapon.rotateSpeed); + mount.rotation = Angles.moveToward(mount.rotation, mount.targetRotation, weapon.rotateSpeed * Time.delta()); }else{ mount.rotation = this.rotation; mount.targetRotation = angleTo(mount.aimX, mount.aimY); diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 265751b514..3f7ee413cb 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -74,6 +74,9 @@ public class Rules{ public boolean tutorial = false; /** Whether a gameover can happen at all. Set this to false to implement custom gameover conditions. */ public boolean canGameOver = true; + /** Whether to draw shadows of blocks at map edges and static blocks. + * Do not change unless you know exactly what you are doing.*/ + public boolean drawFog = true; /** Starting items put in cores */ public Array loadout = Array.with(ItemStack.with(Items.copper, 100)); /** Blocks that cannot be placed. */ diff --git a/core/src/mindustry/world/Build.java b/core/src/mindustry/world/Build.java index ad6b7d255a..ee21b91101 100644 --- a/core/src/mindustry/world/Build.java +++ b/core/src/mindustry/world/Build.java @@ -82,15 +82,15 @@ public class Build{ return false; } + Tile tile = world.tile(x, y); + + if(tile == null) return false; + //ca check if(world.getDarkness(x, y) >= 3){ return false; } - Tile tile = world.tile(x, y); - - if(tile == null) return false; - if(type.isMultiblock()){ if(type.canReplace(tile.block()) && tile.block().size == type.size && type.canPlaceOn(tile) && tile.interactable(team)){ return true; diff --git a/gradle.properties b/gradle.properties index ad952b61d9..3890e6056f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=7287b37c2a36408da69c156014e96850acd0a4f0 +archash=66e5566de0832e721ea552ccd31f0febfb6233d7