Skip to content

Commit

Permalink
Merge branch 'fo-skins' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
drzel committed Aug 8, 2024
2 parents e87c1ab + 402bb8b commit 34628cd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
29 changes: 23 additions & 6 deletions ssqc/commands.qc
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,30 @@ void (entity pl) PrintWho = {
strunzone(msg);
}

void (entity pov, string command, string color, float tno) UpdateTeamColor = {
void (entity pov, string color, float tno) UpdateTeamColor = {
local string command = "";
switch (tno) {
case 1:
command = "team1color";
break;
case 2:
command = "team2color";
break;
case 3:
command = "team3color";
break;
case 4:
command = "team4color";
break;
}

forceinfokey(pov, command, color);

local entity te = find(world, classname, "player");
while (te != world) {
if (te.team_no == tno)
if (te.team_no == tno) {
TeamFortress_SetSkin(te);
}

te = find(te, classname, "player");
}
Expand Down Expand Up @@ -380,19 +397,19 @@ float (string arg1, string arg2, string arg3) ParseCmds = {
}
break;
case "team1color":
UpdateTeamColor(self, "team1color", arg3, 1);
UpdateTeamColor(self, arg3, 1);
processedCmd = TRUE;
break;
case "team2color":
UpdateTeamColor(self, "team2color", arg3, 2);
UpdateTeamColor(self, arg3, 2);
processedCmd = TRUE;
break;
case "team3color":
UpdateTeamColor(self, "team3color", arg3, 3);
UpdateTeamColor(self, arg3, 3);
processedCmd = TRUE;
break;
case "team4color":
UpdateTeamColor(self, "team4color", arg3, 4);
UpdateTeamColor(self, arg3, 4);
processedCmd = TRUE;
break;
}
Expand Down
3 changes: 2 additions & 1 deletion ssqc/tfort.qc
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,8 @@ string(float pc) TeamFortress_GetSkin =

void (entity player) TeamFortress_SetSkinInfos = {
local string st = TeamFortress_GetSkin(player.playerclass);
stuffcmd(player, sprintf("skin %s\n", st));
local string command = sprintf("skin %s\n", st);
stuffcmd(player, command);
forceinfokey(player, "skin", st); // please fix mvd recording

local string color;
Expand Down
2 changes: 1 addition & 1 deletion ssqc/tforttm.qc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ float (float tno) TeamFortress_TeamGetColor = {
};

string TeamFortress_TeamGetColorFor(entity pov, float tno) {
local string color = "FFFFFF";
local string color = "0xFFFFFF";

if (pov.team_no == tno && cvar("teamcolor")) {
color = cvar_string("teamcolor");
Expand Down

0 comments on commit 34628cd

Please sign in to comment.