]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 64fe9fdaae40efa55d52cc24685ddcaa3dc676b0..63632f38af0103d256637f53b063b087dde1e79a 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)