@@ -3147,6 +3147,21 @@ void () UpdateAllClientsTeamScores = {
3147
3147
}
3148
3148
}
3149
3149
3150
+ void (entity pov, entity target) SetSkinInfoFor = {
3151
+ local float target_idx = target.colormap - 1;
3152
+ local string color = TeamFortress_TeamGetColorFor(pov, target.team_no);
3153
+
3154
+ msg_entity = pov;
3155
+ WriteByte(MSG_ONE, SVC_SETINFO);
3156
+ WriteByte(MSG_ONE, target_idx);
3157
+ WriteString(MSG_ONE, "topcolor");
3158
+ WriteString(MSG_ONE, color);
3159
+ WriteByte(MSG_ONE, SVC_SETINFO);
3160
+ WriteByte(MSG_ONE, target_idx);
3161
+ WriteString(MSG_ONE, "bottomcolor");
3162
+ WriteString(MSG_ONE, color);
3163
+ }
3164
+
3150
3165
void () ClientConnect = {
3151
3166
if (!infokeyf(self,INFOKEY_P_CSQCACTIVE)) {
3152
3167
sprint(self, PRINT_HIGH, "FTE/CSQC is required for this server, please download the latest client package at www.fortressone.org\n");
@@ -3207,21 +3222,11 @@ void () ClientConnect = {
3207
3222
UpdateClientPrematch(self, !cb_prematch);
3208
3223
UpdateClient_VoteMap_AddAll(self);
3209
3224
3210
- local string color;
3225
+ // Set skin colours
3211
3226
local entity te = find(world, classname, "player");
3212
3227
while (te != world) {
3213
3228
if (te != self) {
3214
- msg_entity = self;
3215
- color = TeamFortress_TeamGetColorFor(self, te.team_no);
3216
-
3217
- WriteByte(MSG_ONE, SVC_SETINFO);
3218
- WriteByte(MSG_ONE, te.colormap-1); // ???? Copied from spy.qc
3219
- WriteString(MSG_ONE, "topcolor");
3220
- WriteString(MSG_ONE, color);
3221
- WriteByte(MSG_ONE, SVC_SETINFO);
3222
- WriteByte(MSG_ONE, te.colormap-1); // ???? Copied from spy.qc
3223
- WriteString(MSG_ONE, "bottomcolor");
3224
- WriteString(MSG_ONE, color);
3229
+ SetSkinInfoFor(self, te);
3225
3230
}
3226
3231
3227
3232
te = find(te, classname, "player");
0 commit comments