mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-10-31 17:29:25 +00:00
Fixed memory issues with PhaseChange and Torrent. (#727)
Thanks to PhanaticD for reporting these issues.
This commit is contained in:
parent
29a6cb8d05
commit
34be68bb40
|
@ -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;
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue