Skip to content

Commit 481366f

Browse files
committed
Fix EarthKick bugs
- Allow slot swapping once EarthKick is created. This fixes the bug where the falling blocks don't damage enemies if the player swapped slots before they get near an enemy. - Fix an issue with EarthKick where the wrong FallingBlocks could be removed from the tracking list.
1 parent 7533aec commit 481366f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/com/jedk1/jedcore/ability/earthbending/EarthKick.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void progress() {
100100
return;
101101
}
102102

103-
if (!bPlayer.canBendIgnoreCooldowns(this)) {
103+
if (!bPlayer.canBendIgnoreBindsCooldowns(this)) {
104104
remove();
105105
return;
106106
}
@@ -149,13 +149,13 @@ private void launchBlocks() {
149149
}
150150

151151
public void track() {
152-
List<Integer> ids = new ArrayList<>();
152+
List<TempFallingBlock> destroy = new ArrayList<>();
153153

154154
for (TempFallingBlock tfb : temps) {
155155
FallingBlock fb = tfb.getFallingBlock();
156156

157157
if (fb == null || fb.isDead()) {
158-
ids.add(temps.indexOf(tfb));
158+
destroy.add(tfb);
159159
continue;
160160
}
161161

@@ -172,11 +172,7 @@ public void track() {
172172
});
173173
}
174174

175-
for (int id : ids) {
176-
if (id < temps.size()) {
177-
temps.remove(id);
178-
}
179-
}
175+
temps.removeAll(destroy);
180176
}
181177

182178
@Override

0 commit comments

Comments
 (0)