Skip to content

Commit ce7281a

Browse files
committed
Do not require a reason for /team in sandbox
1 parent 3f8fb45 commit ce7281a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

build/scripts/playerCommands.js

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/playerCommands.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,12 +574,13 @@ Please stop attacking and [lime]build defenses[] first!`
574574
},
575575

576576
team: {
577-
args: ['team:team', 'reason:string'],
577+
args: ['team:team', 'reason:string?'],
578578
description: 'Changes your team.',
579579
perm: Perm.changeTeam,
580580
handler({sender, args: {team, reason}, outputSuccess, f}){
581581
if(Gamemode.sandbox() && fishState.peacefulMode && !sender.hasPerm("admin"))
582582
fail(`You do not have permission to change teams because peaceful mode is on.`);
583+
if(!Gamemode.sandbox() && !reason) fail(`Please specify a reason for changing teams.`);
583584
if(!sender.hasPerm("changeTeamExternal")){
584585
if(team.data().cores.size <= 0) fail(`You do not have permission to change to a team with no cores.`);
585586
if(!sender.player!.dead() && !sender.unit()?.spawnedByCore)
@@ -588,7 +589,7 @@ Please stop attacking and [lime]build defenses[] first!`
588589
if(!sender.hasPerm("mod")) sender.changedTeam = true;
589590
sender.setTeam(team);
590591
outputSuccess(f`Changed your team to ${team}.`);
591-
logAction(`changed team to ${team.name} on ${escapeTextDiscord(Vars.state.map.plainName())} with reason ${escapeTextDiscord(reason)}`, sender)
592+
if(reason) logAction(`changed team to ${team.name} on ${escapeTextDiscord(Vars.state.map.plainName())} with reason ${escapeTextDiscord(reason)}`, sender)
592593
},
593594
},
594595

0 commit comments

Comments
 (0)