Skip to content

Commit af3c53e

Browse files
committed
Only validate team when multiple teams exist
1 parent ab05ae5 commit af3c53e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripting/include/model_chooser/structs.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ enum struct PlayerModel
190190
int team = String_IsNumeric(this.team) ? StringToInt(this.team) : FindTeamByName(this.team);
191191
if (team < 0 || team >= MAX_TEAMS)
192192
{
193-
LogError("Invalid team \"%s\" specified for model \"%s\"", this.team, this.name);
193+
if (GetTeamCount() > 1)
194+
{
195+
LogError("Invalid team \"%s\" specified for model \"%s\"", this.team, this.name);
196+
}
194197
team = 0;
195198
}
196199
return team;

0 commit comments

Comments
 (0)