]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Fix an issue and attempt to precache player sounds (not sure if this is correct!)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index c5d85b793bf86606333242c17265922df91a0626..cbf115c92d50b9f2f669e9bdc9e4360e80e317e2 100644 (file)
@@ -166,9 +166,13 @@ void CopyBody(float keepvelocity)
 float player_getspecies()
 {
        local float glob, i, j, fh, len, s, sk;
-       local string fn, l;
+       local string fn, l, file;
        local float tokens;
 
+       file = strcat(substring(self.model, 0, -5), ftos(self.skinindex)); // remove the extension at the end
+       PrecachePlayerSounds(file);
+       UpdatePlayerSounds(file);
+
        s = -1;
 
        glob = search_begin("models/player/*.txt", TRUE, TRUE);
@@ -188,7 +192,6 @@ float player_getspecies()
                        if(fgets(fh) == self.model)
                        {
                                tokens = tokenizebyseparator(fn, ".");
-                               UpdatePlayerSounds(argv(0));
 
                                l = fgets(fh);
                                len = tokenize_console(l);