mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-01-08 04:27:18 +01:00
Merge pull request #26 from HummusSamurai/bugfix-skills-sort
Fixed bug where game crashed if some skills had no requirements when sorted.
This commit is contained in:
@@ -197,6 +197,10 @@ public final class SkillListAdapter extends ArrayAdapter<SkillInfo> {
|
||||
&& item2.canLevelUpSkillTo(player, player.getSkillLevel(item2.id) +1))
|
||||
return 1;
|
||||
else { // Then compare by number of requirements (complexity)
|
||||
if(item1.levelupRequirements == null)
|
||||
return -1;
|
||||
if(item2.levelupRequirements == null)
|
||||
return 1;
|
||||
if(item1.levelupRequirements.length< item2.levelupRequirements.length)
|
||||
return -1;
|
||||
else if(item1.levelupRequirements.length > item2.levelupRequirements.length)
|
||||
|
||||
Reference in New Issue
Block a user