defaultmodel selection: if the player's selected model is in the list, always use...
authorRudolf Polzer <divverent@xonotic.org>
Wed, 18 Sep 2013 08:14:52 +0000 (10:14 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 18 Sep 2013 08:14:52 +0000 (10:14 +0200)
qcsrc/server/cl_client.qc

index 64fe9fd..63632f3 100644 (file)
@@ -297,7 +297,13 @@ void FixPlayermodel()
 
                n = tokenize_console(defaultmodel);
                if(n > 0)
+               {
                        defaultmodel = argv(floor(n * self.model_randomizer));
+                       // However, do NOT randomize if the player-selected model is in the list.
+                       for (i = 0; i < n; ++i)
+                               if ((argv(i) == self.playermodel && defaultskin == self.playerskin) || argv(i) == strcat(self.playermodel, ":", ftos(self.playerskin)))
+                                       defaultmodel = argv(i);
+               }
 
                i = strstrofs(defaultmodel, ":", 0);
                if(i >= 0)