Fix .effectNameToInt loading all sounds (revert f718db8
)
This commit is contained in:
parent
0c5683c043
commit
cd472451f4
1 changed files with 5 additions and 4 deletions
|
@ -122,10 +122,11 @@ public class Effect {
|
||||||
// String comparision is more expensive compared to a single integer one,
|
// 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
|
// and when creating instances of a lot of effects it's better if we can
|
||||||
// save some processor cycles.
|
// save some processor cycles.
|
||||||
final Effect[] effects = getEffects();
|
if (name.equals("vanish")) return 0;
|
||||||
for (int i = 0; i != effects.length; ++i)
|
if (name.equals("waterdrop")) return 1;
|
||||||
if (effects[i].name.equals(name))
|
if (name.equals("evaporate")) return 2;
|
||||||
return i;
|
if (name.equals("spin")) return 3;
|
||||||
|
if (name.equals("explode")) return 4;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue