]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port model_randomizer to ClientState
authorMario <mario@smbclan.net>
Mon, 17 Jul 2017 21:33:05 +0000 (07:33 +1000)
committerMario <mario@smbclan.net>
Mon, 17 Jul 2017 21:33:05 +0000 (07:33 +1000)
qcsrc/server/client.qc
qcsrc/server/client.qh

index abb5693a340481980f363730e2af91eb7f4b59ed..bfb8849c3389ea9ea1f74d53ffd2cfcd9480550e 100644 (file)
@@ -397,7 +397,7 @@ void FixPlayermodel(entity player)
                int n = tokenize_console(defaultmodel);
                if(n > 0)
                {
-                       defaultmodel = argv(floor(n * player.model_randomizer));
+                       defaultmodel = argv(floor(n * CS(player).model_randomizer));
                        // However, do NOT randomize if the player-selected model is in the list.
                        for (int i = 0; i < n; ++i)
                                if ((argv(i) == player.playermodel && defaultskin == stof(player.playerskin)) || argv(i) == strcat(player.playermodel, ":", player.playerskin))
@@ -1252,7 +1252,7 @@ void ClientConnect(entity this)
 
        CSQCMODEL_AUTOINIT(this);
 
-       this.model_randomizer = random();
+       CS(this).model_randomizer = random();
 
        if (IS_REAL_CLIENT(this))
                sv_notice_join(this);
index e2445aa3eb0cfc42af33ba3d5887f7757861f9c5..f0c7a3bef10410430b5892f57d036bf729410f45 100644 (file)
@@ -100,6 +100,7 @@ CLASS(Client, Object)
     ATTRIB(Client, latency_cnt, int, this.latency_cnt);
     ATTRIB(Client, latency_time, float, this.latency_time);
     ATTRIB(Client, v_angle_old, vector, this.v_angle_old);
+    ATTRIB(Client, model_randomizer, float, this.model_randomizer);
 
     METHOD(Client, m_unwind, bool(Client this));