Fixed puddle/IO crash / crafter storage / player NaN position / red tint

This commit is contained in:
Anuken
2018-08-14 12:24:04 -04:00
parent 59ec09e82c
commit f8ddc8325c
6 changed files with 14 additions and 5 deletions
@@ -441,6 +441,13 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
public void update(){
hitTime = Math.max(0f, hitTime - Timers.delta());
if(Float.isNaN(x) || Float.isNaN(y)){
TileEntity core = getClosestCore();
if(core != null){
set(core.x, core.y);
}
}
if(isDead()){
isBoosting = false;
boostHeat = 0f;
@@ -179,7 +179,7 @@ public class Puddle extends BaseEntity implements SaveTrait, Poolable, DrawTrait
float deposited = Math.min((amount - maxLiquid / 1.5f) / 4f, 0.3f) * Timers.delta();
for(GridPoint2 point : Geometry.d4){
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
if(other.block() == Blocks.air && !other.hasCliffs()){
if(other != null && other.block() == Blocks.air && !other.hasCliffs()){
deposit(other, tile, liquid, deposited, generation + 1);
amount -= deposited / 2f; //tweak to speed up/slow down puddle propagation
}