]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Character voices and pain sounds are currently specified as a playermodel.zym.sounds...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 26 Apr 2010 21:29:47 +0000 (00:29 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 26 Apr 2010 21:29:47 +0000 (00:29 +0300)
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh

index ef83ef63543c7dc1a77c1633be408fb5ba45a0c1..c7e83800671566b5034365484e52678354b6822e 100644 (file)
@@ -508,7 +508,6 @@ float Client_customizeentityforclient()
        return TRUE;
 }
 
-void UpdatePlayerSounds();
 void setmodel_lod(entity e, string modelname)
 {
        string s;
@@ -556,7 +555,6 @@ void setmodel_lod(entity e, string modelname)
        self.modelindex_lod0_from_xonotic = ((s == "") || (substring(s, 0, 4) == "data"));
 
        player_setupanimsformodel();
-       UpdatePlayerSounds();
 }
 
 /*
index 8925f171340d0de0cbab5feb0076a9b3370aaa65..df389f5da1587d8af7fae62c518289c3148129de 100644 (file)
@@ -167,6 +167,7 @@ float player_getspecies()
 {
        local float glob, i, j, fh, len, s, sk;
        local string fn, l;
+       local float tokens;
 
        s = -1;
 
@@ -186,6 +187,9 @@ float player_getspecies()
                        if(sk == (j ? 0 : self.skinindex)) // 2nd pass skips the skin test
                        if(fgets(fh) == self.model)
                        {
+                               tokens = tokenizebyseparator(fn, ".");
+                               UpdatePlayerSounds(argv(0));
+
                                l = fgets(fh);
                                len = tokenize_console(l);
                                if (len != 2)
@@ -1264,14 +1268,15 @@ void LoadPlayerSounds(string f, float first)
 }
 
 .float modelindex_for_playersound;
-void UpdatePlayerSounds()
+void UpdatePlayerSounds(string filename)
 {
        if(self.modelindex == self.modelindex_for_playersound)
                return;
        self.modelindex_for_playersound = self.modelindex;
        ClearPlayerSounds();
        LoadPlayerSounds("sound/player/default.sounds", 1);
-       LoadPlayerSounds(strcat(self.model, ".sounds"), 0);
+       if(filename != "")
+               LoadPlayerSounds(strcat(filename, ".sounds"), 0);
 }
 
 void FakeGlobalSound(string sample, float chan, float voicetype)
index b487e3de77aa81cf455c54a68248f393cdc0aea1..5e7c83cf2378db7e02c47b428e6c97afe0138164 100644 (file)
@@ -501,7 +501,7 @@ string globalsound_metalstep;
 
 void PrecachePlayerSounds(string f);
 void PrecacheGlobalSound(string samplestring);
-void UpdatePlayerSounds();
+void UpdatePlayerSounds(string filename);
 void ClearPlayerSounds();
 void PlayerSound(.string samplefield, float channel, float voicetype);
 void GlobalSound(string samplestring, float channel, float voicetype);