From: Mario Date: Mon, 17 Jul 2017 21:33:05 +0000 (+1000) Subject: Port model_randomizer to ClientState X-Git-Tag: xonotic-v0.8.5~2575 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7fbf417fa776db4949e6e9bfa0e9d6aa1d05f4d9;p=xonotic%2Fxonotic-data.pk3dir.git Port model_randomizer to ClientState --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index abb5693a3..bfb8849c3 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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); diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index e2445aa3e..f0c7a3bef 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -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));