]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Merge branch 'master' of git://git.xonotic.org/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index 79206585cb085df1fb8a18b2eccd811e2dd09733..342cbbc3d69e4a8e6e9a011c246e14d892f24a09 100644 (file)
@@ -168,7 +168,7 @@ void CopyBody(float keepvelocity)
 float player_getspecies()
 {
        float s;
-       get_model_parameters(self.playermodel, self.skinindex);
+       get_model_parameters(self.model, self.skinindex);
        s = get_model_parameters_species;
        get_model_parameters(string_null, 0);
        if(s < 0)
@@ -669,7 +669,12 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                waves = 0;
                sdelay = cvar(strcat("g_", GetGametype(), "_respawn_delay"));
                if(!sdelay)
-                       sdelay = autocvar_g_respawn_delay;
+        {
+            if(g_cts)
+                sdelay = 0; // no respawn delay in CTS
+            else
+                sdelay = autocvar_g_respawn_delay;
+        }
                waves = cvar(strcat("g_", GetGametype(), "_respawn_waves"));
                if(!waves)
                        waves = autocvar_g_respawn_waves;
@@ -1147,12 +1152,9 @@ float GetVoiceMessageVoiceType(string type)
 }
 
 string allvoicesamples;
-float GetPlayerSoundSampleField_notFound;
-float GetPlayerSoundSampleField_fixed;
 .string GetVoiceMessageSampleField(string type)
 {
        GetPlayerSoundSampleField_notFound = 0;
-       GetPlayerSoundSampleField_fixed = 0;
        switch(type)
        {
 #define _VOICEMSG(m) case #m: return playersound_##m;
@@ -1166,7 +1168,6 @@ float GetPlayerSoundSampleField_fixed;
 .string GetPlayerSoundSampleField(string type)
 {
        GetPlayerSoundSampleField_notFound = 0;
-       GetPlayerSoundSampleField_fixed = 0;
        switch(type)
        {
 #define _VOICEMSG(m) case #m: return playersound_##m;
@@ -1228,7 +1229,7 @@ void ClearPlayerSounds()
 #undef _VOICEMSG
 }
 
-void LoadPlayerSounds(string f, float first)
+float LoadPlayerSounds(string f, float first)
 {
        float fh;
        string s;
@@ -1237,7 +1238,7 @@ void LoadPlayerSounds(string f, float first)
        if(fh < 0)
        {
                dprint("Player sound file not found: ", f, "\n");
-               return;
+               return 0;
        }
        while((s = fgets(fh)))
        {
@@ -1248,14 +1249,12 @@ void LoadPlayerSounds(string f, float first)
                        field = GetVoiceMessageSampleField(argv(0));
                if(GetPlayerSoundSampleField_notFound)
                        continue;
-               if(GetPlayerSoundSampleField_fixed)
-                       if not(first)
-                               continue;
                if(self.field)
                        strunzone(self.field);
                self.field = strzone(strcat(argv(1), " ", argv(2)));
        }
        fclose(fh);
+       return 1;
 }
 
 .float modelindex_for_playersound;
@@ -1269,7 +1268,8 @@ void UpdatePlayerSounds()
        self.skinindex_for_playersound = self.skinindex;
        ClearPlayerSounds();
        LoadPlayerSounds("sound/player/default.sounds", 1);
-       LoadPlayerSounds(get_model_datafilename(self.playermodel, self.skinindex, "sounds"), 0);
+       if(!LoadPlayerSounds(get_model_datafilename(self.model, self.skinindex, "sounds"), 0))
+               LoadPlayerSounds(get_model_datafilename(self.model, 0, "sounds"), 0);
 }
 
 void FakeGlobalSound(string sample, float chan, float voicetype)