Skip to content

Commit

Permalink
Wrong April Fools check.
Browse files Browse the repository at this point in the history
Resolves #159
  • Loading branch information
C9Glax committed Apr 16, 2024
1 parent e022bf3 commit 431fde0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Tranga/Tranga.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void StartJobBoss()
{
while (keepRunning)
{
if(!settings.aprilFoolsMode & !IsAprilFirst())
if(!settings.aprilFoolsMode || !IsAprilFirst())
jobBoss.CheckJobs();
else
Log("April Fools Mode in Effect");
Expand Down

3 comments on commit 431fde0

@db-2001
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make more sense for the settings.aprilFoolsMode check to be inside IsAprilFirst()? Like if the setting is true, do the check but if it's false, always have IsAprilFirst() return false.

Maybe I'm not understanding this logic but it seems to me that we'll check jobs if April fools mode is false OR if it's not April first. So it doesn't matter what the setting is because it will always not check jobs on April first.

@db-2001
Copy link
Collaborator

Choose a reason for hiding this comment

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

Or we put CheckJobs in the else since we want that to be the default and log April Fools Mode only when settings.aprilFoolsMode & IsAprilFirst()

@C9Glax
Copy link
Owner Author

@C9Glax C9Glax commented on 431fde0 Apr 16, 2024

Choose a reason for hiding this comment

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

Expected Behaviour:
If April Fools Mode is disabled (!settings.aprilFoolsMode returns true - which is the case when settings.aprilFoolsMode = false) -
or if it is enabled (!settings.aprilFoolsMode returns false) and it is not April 1st !IsAprilFirst(),
check Jobs.

Otherwise do nothing.

So the logic itself is correct. Ofc you could negate everything settings.aprilFoolsMode && IsAprilFirst() and then do nothing.
You can also move the settings.aprilFoolsMode check to the function and rename it AprilFoolsCheck() or something.

Please sign in to comment.