aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/sound
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2004-10-21 02:45:55 +0000
committerCarsten Weisse <[email protected]>2004-10-21 02:45:55 +0000
commitfda0da9a892779af86906733019ca2c993da0161 (patch)
treef540278fbe1287abe1aa568372dabca522930d2f /src/jake2/sound
parentce28e8d9a8a95140211379a986efa72398d47999 (diff)
selection of sexed sounds are now correct
Diffstat (limited to 'src/jake2/sound')
-rw-r--r--src/jake2/sound/joal/JOALSoundImpl.java37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/jake2/sound/joal/JOALSoundImpl.java b/src/jake2/sound/joal/JOALSoundImpl.java
index e07ba8d..5a1df21 100644
--- a/src/jake2/sound/joal/JOALSoundImpl.java
+++ b/src/jake2/sound/joal/JOALSoundImpl.java
@@ -2,7 +2,7 @@
* JOALSoundImpl.java
* Copyright (C) 2004
*
- * $Id: JOALSoundImpl.java,v 1.6 2004-10-21 01:51:45 cawe Exp $
+ * $Id: JOALSoundImpl.java,v 1.7 2004-10-21 02:45:55 cawe Exp $
*/
package jake2.sound.joal;
@@ -629,25 +629,26 @@ public final class JOALSoundImpl implements Sound {
//Com_sprintf (sexedFilename, sizeof(sexedFilename), "#players/%s/%s", model, base+1);
sfx = FindName(sexedFilename, false);
- if (sfx == null) {
- // no, so see if it exists
- int fileLength = FS.FileLength(sexedFilename.substring(1));
- if (fileLength > 0) {
- // yes, register it
- sfx = RegisterSound(sexedFilename);
- } else if (model.equalsIgnoreCase("female")) {
- // retry it with female pak-file sounds
- String femaleFilename = "player/female/" + base.substring(1);
- sfx = AliasName(sexedFilename, femaleFilename);
- } else {
- // no chance, revert to the male sound in the pak0.pak
- String maleFilename = "player/male/" + base.substring(1);
- sfx = AliasName(sexedFilename, maleFilename);
- }
+ if (sfx != null) return sfx;
+
+ //
+ // fall back strategies
+ //
+ // not found , so see if it exists
+ if (FS.FileLength(sexedFilename.substring(1)) > 0) {
+ // yes, register it
+ return RegisterSound(sexedFilename);
}
- return sfx;
+ // try it with the female sound in the pak0.pak
+ if (model.equalsIgnoreCase("female")) {
+ String femaleFilename = "player/female/" + base.substring(1);
+ if (FS.FileLength("sound/" + femaleFilename) > 0)
+ return AliasName(sexedFilename, femaleFilename);
+ }
+ // no chance, revert to the male sound in the pak0.pak
+ String maleFilename = "player/male/" + base.substring(1);
+ return AliasName(sexedFilename, maleFilename);
}
-
static sfx_t[] known_sfx = new sfx_t[MAX_SFX];
static {