From: Mircea Kitsune Date: Tue, 4 May 2010 12:09:43 +0000 (+0300) Subject: Use substring instead. Move code in correct location. X-Git-Tag: xonotic-v0.1.0preview~637^2^2~14 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2a6a1ae8dd05e0516e60c0f61f3e7f778a1ef83a;p=xonotic%2Fxonotic-data.pk3dir.git Use substring instead. Move code in correct location. --- diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 72c3a67b7..4713c988d 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -166,8 +166,12 @@ void CopyBody(float keepvelocity) float player_getspecies() { local float glob, i, j, fh, len, s, sk; - local string fn, l; - local float tokens, snd; + local string fn, l, file; + local float tokens; + + file = substring(self.model, 0, -5); // remove the extension at the end + UpdatePlayerSounds(strcat(file, ftos(sk))); + dprint(strcat(" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ", file, ftos(sk))); s = -1; @@ -184,10 +188,6 @@ float player_getspecies() continue; fgets(fh); fgets(fh); sk = stof(fgets(fh)); - - snd = tokenizebyseparator(self.model, "."); // don't use the .zym at the end - UpdatePlayerSounds(strcat(argv(0), ftos(sk))); - if(sk == (j ? 0 : self.skinindex)) // 2nd pass skips the skin test if(fgets(fh) == self.model) {