Skip to content

Commit

Permalink
chore: Buff Out A Few Rough Spots
Browse files Browse the repository at this point in the history
- Adjust some bitwise ands (&) to boolean ands (&&) in games.
  - In these instances though, bitwise was probably close enough.
  - Boolean logic is clearly intended, however, so let's use that.
- Fix a `Function<bool>` type to be `Function<boolean>`.
- Adjust one absolute path import to a relative path import.
  - VSCode at least treats the import as a first-class passenger again,
  - When it was previously crammed into the cargo hold.
  • Loading branch information
phroggster committed Jan 7, 2025
1 parent 60a2b4a commit e7cc60c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/backend/games/builtin/bid/bid-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const bidCommand = {
}

const minBid = bidSettings.settings.currencySettings.minBid;
if (minBid != null & minBid > 0) {
if (minBid != null && minBid > 0) {
if (bidAmount < minBid) {
await twitchChat.sendChatMessage(`Bid amount must be at least ${minBid} ${currencyName}.`, null, chatter, chatMessage.id);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/backend/games/builtin/heist/heist-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const heistCommand = {

// make sure wager doesnt violate min or max values
const minWager = heistSettings.settings.currencySettings.minWager || 1;
if (minWager != null & minWager > 0) {
if (minWager != null && minWager > 0) {
if (wagerAmount < minWager) {
if (heistSettings.settings.entryMessages.wagerAmountTooLow) {
const wagerAmountTooLowMsg = heistSettings.settings.entryMessages.wagerAmountTooLow
Expand All @@ -135,7 +135,7 @@ const heistCommand = {
}
}
const maxWager = heistSettings.settings.currencySettings.maxWager;
if (maxWager != null & maxWager > 0) {
if (maxWager != null && maxWager > 0) {
if (wagerAmount > maxWager) {
if (heistSettings.settings.entryMessages.wagerAmountTooHigh) {
const wagerAmountTooHighMsg = heistSettings.settings.entryMessages.wagerAmountTooHigh
Expand Down
4 changes: 2 additions & 2 deletions src/backend/games/builtin/slots/spin-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const spinCommand = {
}

const minWager = slotsSettings.settings.currencySettings.minWager;
if (minWager != null & minWager > 0) {
if (minWager != null && minWager > 0) {
if (wagerAmount < minWager) {
if (slotsSettings.settings.generalMessages.minWager) {
const minWagerMsg = slotsSettings.settings.generalMessages.minWager
Expand All @@ -132,7 +132,7 @@ const spinCommand = {
}
}
const maxWager = slotsSettings.settings.currencySettings.maxWager;
if (maxWager != null & maxWager > 0) {
if (maxWager != null && maxWager > 0) {
if (wagerAmount > maxWager) {
if (slotsSettings.settings.generalMessages.maxWager) {
const maxWagerMsg = slotsSettings.settings.generalMessages.maxWager
Expand Down
2 changes: 1 addition & 1 deletion src/backend/games/builtin/trivia/trivia-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const triviaCommand = {
}
}
const maxWager = triviaSettings.settings.currencySettings.maxWager;
if (maxWager != null & maxWager > 0) {
if (maxWager != null && maxWager > 0) {
if (wagerAmount > maxWager) {
await twitchChat.sendChatMessage(`${user.displayName}, your wager amount can be no more than ${maxWager}.`, null, chatter);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/types/effects.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type EffectType<EffectModel = unknown, OverlayData = unknown> = {
description: string;
icon: string;
categories: EffectCategory[];
hidden?: boolean | Func<bool>;
hidden?: boolean | Func<boolean>;
triggers?: TriggerType[] | TriggersObject;
dependencies?: EffectDependencies | Array<"chat">;
showWhenDependenciesNotMet?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/types/events.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComparisonType } from "src/shared/filter-constants";
import { ComparisonType } from "../shared/filter-constants";

export type EventSource = {
id: string;
Expand Down

0 comments on commit e7cc60c

Please sign in to comment.