Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

Commit cd47245

Browse files
committed
Fix .effectNameToInt loading all sounds (revert f718db8)
1 parent 0c5683c commit cd47245

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

core/src/io/github/lonamiwebs/klooni/Effect.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ private static int effectNameToInt(final String name) {
122122
// String comparision is more expensive compared to a single integer one,
123123
// and when creating instances of a lot of effects it's better if we can
124124
// save some processor cycles.
125-
final Effect[] effects = getEffects();
126-
for (int i = 0; i != effects.length; ++i)
127-
if (effects[i].name.equals(name))
128-
return i;
125+
if (name.equals("vanish")) return 0;
126+
if (name.equals("waterdrop")) return 1;
127+
if (name.equals("evaporate")) return 2;
128+
if (name.equals("spin")) return 3;
129+
if (name.equals("explode")) return 4;
129130
return -1;
130131
}
131132

0 commit comments

Comments
 (0)