Fix ChiCombo NPE and FallDamage

This commit is contained in:
jedk1 2016-02-20 17:36:22 +00:00
parent 4f4335e498
commit 3d2676a999

View file

@ -55,7 +55,9 @@ public class ChiCombo extends ChiAbility implements ComboAbility {
* @param duration The time in milliseconds the target will be paralyzed
*/
private static void paralyze(Entity target, Long duration) {
PARALYZED_ENTITIES.put(target, (System.currentTimeMillis() + duration));
if (target != null) {
PARALYZED_ENTITIES.put(target, (System.currentTimeMillis() + duration));
}
}
/**
@ -86,6 +88,7 @@ public class ChiCombo extends ChiAbility implements ComboAbility {
*/
public static void handleParalysis() {
for (Entity entity : PARALYZED_ENTITIES.keySet()) {
entity.setFallDistance(0);
if (PARALYZED_ENTITIES.get(entity) <= System.currentTimeMillis()) {
PARALYZED_ENTITIES.remove(entity);