Skip to content

Commit e3c52d6

Browse files
committed
Refactor
1 parent 34b4920 commit e3c52d6

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

ssqc/commands.qc

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -313,24 +313,7 @@ void (entity pl) PrintWho = {
313313
strunzone(msg);
314314
}
315315

316-
void (entity pov, string color, float tno) UpdateTeamColor = {
317-
local string command = "";
318-
319-
switch (tno) {
320-
case 1:
321-
command = "team1color";
322-
break;
323-
case 2:
324-
command = "team2color";
325-
break;
326-
case 3:
327-
command = "team3color";
328-
break;
329-
case 4:
330-
command = "team4color";
331-
break;
332-
}
333-
316+
void (entity pov, string command, string color) UpdateTeamColor = {
334317
forceinfokey(pov, command, color);
335318

336319
local entity te = find(world, classname, "player");
@@ -387,19 +370,10 @@ float (string arg1, string arg2, string arg3) ParseCmds = {
387370
/* processedCmd = TRUE; */
388371
/* break; */
389372
case "team1color":
390-
UpdateTeamColor(self, arg3, 1);
391-
processedCmd = TRUE;
392-
break;
393373
case "team2color":
394-
UpdateTeamColor(self, arg3, 2);
395-
processedCmd = TRUE;
396-
break;
397374
case "team3color":
398-
UpdateTeamColor(self, arg3, 3);
399-
processedCmd = TRUE;
400-
break;
401375
case "team4color":
402-
UpdateTeamColor(self, arg3, 4);
376+
UpdateTeamColor(self, arg2, arg3);
403377
processedCmd = TRUE;
404378
break;
405379
}

0 commit comments

Comments
 (0)