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);
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (bPlayer == null) {
return;
FROZEN_BLOCKS.remove(block);
continue;
} else if (block.getBlock().getType() != Material.ICE) {
FROZEN_BLOCKS.remove(block);
continue;

View file

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