Skip to content

Commit fc1b252

Browse files
committed
Merge branch 'fo-skins' into staging
2 parents 34628cd + ec294f5 commit fc1b252

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

ssqc/client.qc

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,16 +2258,6 @@ void () PutClientInServer = {
22582258
TeamFortress_SetHealth();
22592259
TeamFortress_SetSpeed(self);
22602260
TeamFortress_SetSkin(self);
2261-
2262-
te = find(world, classname, "player");
2263-
while (te != world) {
2264-
if (te != self) {
2265-
TeamFortress_SetSkin(te);
2266-
}
2267-
2268-
te = find(te, classname, "player");
2269-
}
2270-
22712261
TeamFortress_StartTimers();
22722262

22732263
if(quadmode && quad_roles) {
@@ -3157,6 +3147,21 @@ void () UpdateAllClientsTeamScores = {
31573147
}
31583148
}
31593149

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+
31603165
void () ClientConnect = {
31613166
if (!infokeyf(self,INFOKEY_P_CSQCACTIVE)) {
31623167
sprint(self, PRINT_HIGH, "FTE/CSQC is required for this server, please download the latest client package at www.fortressone.org\n");
@@ -3217,6 +3222,16 @@ void () ClientConnect = {
32173222
UpdateClientPrematch(self, !cb_prematch);
32183223
UpdateClient_VoteMap_AddAll(self);
32193224

3225+
// Set skin colours
3226+
local entity te = find(world, classname, "player");
3227+
while (te != world) {
3228+
if (te != self) {
3229+
SetSkinInfoFor(self, te);
3230+
}
3231+
3232+
te = find(te, classname, "player");
3233+
}
3234+
32203235
if (cb_prematch)
32213236
sprint(self, PRINT_HIGH, "Currently in \sprematch\s time\n");
32223237
};

ssqc/engineer.qc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ void () TeamFortress_FinishedBuilding = {
10401040
newmis.th_die = Sentry_Die;
10411041
newmis.th_pain = Sentry_Pain;
10421042
newmis.mdl = "progs/turrgun.mdl";
1043+
newmis.colormod = '0.5 0.5 0.5';
10431044
self.sentry_ent = newmis;
10441045
FO_Sound(oldself, CHAN_ITEM, "weapons/turrset.wav", 1, 1);
10451046
newmis.solid = SOLID_BBOX;

ssqc/tfort.qc

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,28 +1173,16 @@ string(float pc) TeamFortress_GetSkin =
11731173
return skin;
11741174
};
11751175

1176-
11771176
void (entity player) TeamFortress_SetSkinInfos = {
11781177
local string st = TeamFortress_GetSkin(player.playerclass);
11791178
local string command = sprintf("skin %s\n", st);
11801179
stuffcmd(player, command);
11811180
forceinfokey(player, "skin", st); // please fix mvd recording
11821181

1183-
local string color;
11841182
local entity te = find(world, classname, "player");
11851183
while (te != world) {
11861184
if (te != player) {
1187-
msg_entity = te;
1188-
color = TeamFortress_TeamGetColorFor(te, player.team_no);
1189-
1190-
WriteByte(MSG_ONE, SVC_SETINFO);
1191-
WriteByte(MSG_ONE, player.colormap-1); // ???? Copied from spy.qc
1192-
WriteString(MSG_ONE, "topcolor");
1193-
WriteString(MSG_ONE, color);
1194-
WriteByte(MSG_ONE, SVC_SETINFO);
1195-
WriteByte(MSG_ONE, player.colormap-1); // ???? Copied from spy.qc
1196-
WriteString(MSG_ONE, "bottomcolor");
1197-
WriteString(MSG_ONE, color);
1185+
SetSkinInfoFor(te, player);
11981186
}
11991187

12001188
te = find(te, classname, "player");

0 commit comments

Comments
 (0)