File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -202,20 +202,21 @@ private void removeFromTiles() {
202202 }
203203 } else {
204204 Neutral prevStacked = tile .getNeutral ();
205- while (! this . equals ( prevStacked . getNextStacked ()) && !this .equals (prevStacked .getNextStacked ())) {
205+ while (prevStacked != null && !this .equals (prevStacked .getNextStacked ())) {
206206 prevStacked = prevStacked .getNextStacked ();
207207 }
208- if (!((NeutralImpl ) prevStacked ).isSameUnitTypeAs (this )) {
209- // bwem_assert(pPrevStacked->Type() == Type());
210- throw new IllegalStateException ();
211- } else if (!(prevStacked .getTopLeft ().equals (getTopLeft ()))) {
212- // bwem_assert(pPrevStacked->topLeft() == topLeft());
213- throw new IllegalStateException ();
214- } else if (!(dx == 0 && dy == 0 )) {
208+ if (!(dx == 0 && dy == 0 )) {
215209 // bwem_assert((dx == 0) && (dy == 0));
216210 throw new IllegalStateException ();
217211 }
218212 if (prevStacked != null ) {
213+ if (!((NeutralImpl ) prevStacked ).isSameUnitTypeAs (this )) {
214+ // bwem_assert(pPrevStacked->Type() == Type());
215+ throw new IllegalStateException ();
216+ } else if (!(prevStacked .getTopLeft ().equals (getTopLeft ()))) {
217+ // bwem_assert(pPrevStacked->topLeft() == topLeft());
218+ throw new IllegalStateException ();
219+ }
219220 ((NeutralImpl ) prevStacked ).nextStacked = nextStacked ;
220221 }
221222 this .nextStacked = null ;
You can’t perform that action at this time.
0 commit comments