From: Rudolf Polzer Date: Wed, 18 Sep 2013 08:14:52 +0000 (+0200) Subject: defaultmodel selection: if the player's selected model is in the list, always use... X-Git-Tag: xonotic-v0.8.0~326 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a5d6f8e1c3347dff7529eef778bbeb91fd117bc1;p=xonotic%2Fxonotic-data.pk3dir.git defaultmodel selection: if the player's selected model is in the list, always use that (no randomization then) --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 64fe9fdaa..63632f38a 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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)