Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/suspects: Rename setcoil #10667

Merged
merged 3 commits into from
Nov 11, 2024
Merged

/suspects: Rename setcoil #10667

merged 3 commits into from
Nov 11, 2024

Conversation

KrisXV
Copy link
Member

@KrisXV KrisXV commented Nov 9, 2024

setbvalue makes more sense than setcoil since the property being adjusted is the b value, and the COIL threshold is set separately in /suspects add (perhaps support can also be added to the latter command to require the b value as an argument if coil is specified?). I also called Dex.formats.get earlier on in the command because the formatting of using a format's name is more fitting with the rest of the design of /suspects.

@KrisXV KrisXV requested a review from mia-pi-git November 9, 2024 02:50
let bVal: number | undefined = parseFloat(source);
if (cmd.startsWith('d')) {
bVal = undefined;
} else if (!source || isNaN(bVal) || bVal < 1) {
return this.errorReply(`Specify a valid COIL B value.`);
}
if (!formatid || !Dex.formats.get(formatid).exists) {
if (!toID(formatStr) || !format.exists) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the first check for the formatStr argument isn't required since Dex.formats.get sanitizes the string even if no format exists, but I left this in regardless

@KrisXV KrisXV merged commit 30f22d2 into smogon:master Nov 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant