From cc39cc79f9f845fadb0aeb2758fa6cd5e82f6404 Mon Sep 17 00:00:00 2001 From: Loony Date: Wed, 27 Jul 2016 21:12:23 +0100 Subject: [PATCH] Bug fixes (#523) * Fixes NPE with surge wave & bottles * Fixed bracket :S For some reason it PR'd my bracket and code separate? Weird. * Changed dayfactor placement so that it's correct with avatar state factor --- .../projectkorra/firebending/FireBlastCharged.java | 8 ++++---- .../projectkorra/projectkorra/waterbending/SurgeWave.java | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java b/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java index 56f52cb2..bd562a81 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java +++ b/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java @@ -70,18 +70,18 @@ public class FireBlastCharged extends FireAbility { if (isDay(player.getWorld())) { this.chargeTime = (long) (chargeTime / getDayFactor()); + this.maxDamage = getDayFactor(maxDamage); + this.range = getDayFactor(range); } if (bPlayer.isAvatarState()) { this.chargeTime = 0; this.maxDamage = AvatarState.getValue(maxDamage); } - this.range = getDayFactor(range); + if (!player.getEyeLocation().getBlock().isLiquid()) { start(); - } if (isDay(player.getWorld())) { - this.maxDamage = getDayFactor(maxDamage); - } + } } public static boolean annihilateBlasts(Location location, double radius, Player source) { diff --git a/src/com/projectkorra/projectkorra/waterbending/SurgeWave.java b/src/com/projectkorra/projectkorra/waterbending/SurgeWave.java index 89840a2f..5e656aac 100644 --- a/src/com/projectkorra/projectkorra/waterbending/SurgeWave.java +++ b/src/com/projectkorra/projectkorra/waterbending/SurgeWave.java @@ -356,8 +356,10 @@ public class SurgeWave extends WaterAbility { public void returnWater() { if (location != null) { + if (player.isOnline()) { new WaterReturn(player, location.getBlock()); } + } } private void thaw() {