Skip to content

Commit

Permalink
Skin : remove illegal offset value on prepare()
Browse files Browse the repository at this point in the history
  • Loading branch information
exch-bms2 committed Oct 11, 2017
1 parent 4f87f48 commit 0c721f2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/bms/player/beatoraja/skin/Skin.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.utils.IntArray;

import java.util.*;
import java.util.logging.Logger;
Expand Down Expand Up @@ -124,7 +125,7 @@ public void prepare(MainState state) {
if(obj.getAllDestination().length == 0) {
removes.add(obj);
} else {
List<Integer> l = new ArrayList();
IntArray l = new IntArray();
for(int op : obj.getOption()) {
if(op > 0) {
if(option.containsKey(op)) {
Expand Down Expand Up @@ -168,11 +169,15 @@ public void prepare(MainState state) {
}
}
}
int[] newop = new int[l.size()];
for(int i = 0;i < newop.length;i++) {
newop[i] = l.get(i);
obj.setOption(l.toArray());

IntArray off = new IntArray();
for(int offset : obj.getOffsetID()) {
if(offset > 0 && offset < SkinProperty.OFFSET_MAX + 1) {
off.add(offset);
}
}
obj.setOption(newop);
obj.setOffsetID(off.toArray());
}

}
Expand Down

0 comments on commit 0c721f2

Please sign in to comment.