refactor
This commit is contained in:
@@ -40,18 +40,19 @@ public class SwapCommand : ICommand
|
||||
"096",
|
||||
"106",
|
||||
"173",
|
||||
"939",
|
||||
"939"
|
||||
];
|
||||
|
||||
var arg = arguments.First();
|
||||
|
||||
|
||||
if (!validScp.Contains(arg))
|
||||
{
|
||||
response = "Invalid SCP number.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Player.List.Where(x=>x.IsSCP).Select(x=>x.RoleBase).Any(playerRole => playerRole.RoleName == "SCP-" + arg))
|
||||
|
||||
if (Player.List.Where(x => x.IsSCP).Select(x => x.RoleBase)
|
||||
.Any(playerRole => playerRole.RoleName == "SCP-" + arg))
|
||||
{
|
||||
response = "Already exists";
|
||||
return false;
|
||||
@@ -69,7 +70,7 @@ public class SwapCommand : ICommand
|
||||
};
|
||||
|
||||
player.SetRole(role);
|
||||
|
||||
|
||||
response = "Swapping...";
|
||||
|
||||
return true;
|
||||
@@ -77,5 +78,5 @@ public class SwapCommand : ICommand
|
||||
|
||||
public string Command { get; } = "scpswap";
|
||||
public string[] Aliases { get; } = ["ss"];
|
||||
public string Description { get; } = "Swaps SCPs";
|
||||
public string Description { get; } = "Swaps SCPs";
|
||||
}
|
||||
Reference in New Issue
Block a user