Fixed memory issues with PhaseChange and Torrent. (#727)

Thanks to PhanaticD for reporting these issues.
This commit is contained in:
Sobki 2017-02-11 17:26:33 +10:00 committed by Christopher Martin
parent 29a6cb8d05
commit 34be68bb40
2 changed files with 3 additions and 2 deletions

View file

@ -582,7 +582,8 @@ public class Torrent extends WaterAbility {
Player player = FROZEN_BLOCKS.get(block); Player player = FROZEN_BLOCKS.get(block);
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player); BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (bPlayer == null) { if (bPlayer == null) {
return; FROZEN_BLOCKS.remove(block);
continue;
} else if (block.getBlock().getType() != Material.ICE) { } else if (block.getBlock().getType() != Material.ICE) {
FROZEN_BLOCKS.remove(block); FROZEN_BLOCKS.remove(block);
continue; continue;

View file

@ -431,10 +431,10 @@ public class PhaseChange extends IceAbility {
public void revertFrozenBlocks() { public void revertFrozenBlocks() {
if (active_types.contains(PhaseChangeType.FREEZE)) { if (active_types.contains(PhaseChangeType.FREEZE)) {
for (TempBlock tb : blocks) { for (TempBlock tb : blocks) {
PLAYER_BY_BLOCK.remove(tb);
tb.revertBlock(); tb.revertBlock();
} }
blocks.clear(); blocks.clear();
PLAYER_BY_BLOCK.remove(player);
} }
} }