Skip to content

Commit

Permalink
Add bAllowChangingTeams And bAllowChangingNames
Browse files Browse the repository at this point in the history
  • Loading branch information
Deaod committed Mar 8, 2024
1 parent 8bddf95 commit 11d31c4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Classes/NewCTF.uc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ var(Game) config bool bEnableModifiedFlagDrop;
var(Game) config float FlagDropMaximumSpeed;
// Using this password will automatically assign you as spectator
var(Game) config string SpectatorPassword;
// Whether players can change teams after joining
var(Game) config bool bAllowChangingTeams;
// Whether players can change their names after joining
var(Game) config bool bAllowChangingNames;
// Whether teams and names should be assigned based on the password provided by players
var(Game) config bool bEnableAssignedTeams;
// Configures which teams are assigned to which passwords contained in GamePassword
Expand Down Expand Up @@ -998,6 +1002,18 @@ function float GetFlagTimeout() {
return FlagTimeout;
}
function bool ChangeTeam(Pawn Other, int NewTeam) {
if (bAllowChangingTeams) {
return super.ChangeTeam(Other, NewTeam);
}
return false;
}
function ChangeName(Pawn Other, string S, bool bNameChange) {
if (bAllowChangingNames)
super.ChangeName(Other, S, bNameChange);
}
function LogLine(coerce string S) {
Log(LogIndentation$S, 'NewCTF');
}
Expand Down Expand Up @@ -1075,6 +1091,8 @@ defaultproperties
FlagDropMaximumSpeed=200.0
SpectatorPassword=""
bAllowChangingTeams=True
bAllowChangingNames=True
bEnableAssignedTeams=False
AssignedTeamStrategy="0000011111"
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ FlagTimeout=25.0
FlagAdvantageTimeout=25.0
FlagOvertimeTimeout=25.0
SpectatorPassword=""
bAllowChangingTeams=True
bAllowChangingNames=True
bEnableAssignedTeams=False
AssignedTeamStrategy="0000011111"
```
Expand Down Expand Up @@ -146,6 +148,12 @@ If set, players that use it will automatically be assigned the spectator role up

Must not be the same as `GamePassword`.

### bAllowChangingTeams
Controls whether players are able to change teams after joining.

### bAllowChangingNames
Controls whether players are able to change their names after joining.

### bEnableAssignedTeams
Enables assigning players to teams based on the password they use. The individual passwords are contained in GamePassword and to be separated by `;`. The team those players are assigned to is determined by `AssignedTeamStrategy`.

Expand Down

0 comments on commit 11d31c4

Please sign in to comment.