Skip to content

Commit

Permalink
Fix .effectNameToInt loading all sounds (revert f718db8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Sep 10, 2017
1 parent 0c5683c commit cd47245
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/src/io/github/lonamiwebs/klooni/Effect.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ private static int effectNameToInt(final String name) {
// String comparision is more expensive compared to a single integer one,
// and when creating instances of a lot of effects it's better if we can
// save some processor cycles.
final Effect[] effects = getEffects();
for (int i = 0; i != effects.length; ++i)
if (effects[i].name.equals(name))
return i;
if (name.equals("vanish")) return 0;
if (name.equals("waterdrop")) return 1;
if (name.equals("evaporate")) return 2;
if (name.equals("spin")) return 3;
if (name.equals("explode")) return 4;
return -1;
}

Expand Down

0 comments on commit cd47245

Please sign in to comment.