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

Fix logic error in SlaveJob #1840

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

SquishyPandaDev
Copy link

Fix the player being unable to assign the maximum number of slaves to certain jobs.

Discord: mightbefluffy

@CognitiveMist
Copy link
Contributor

I'm not sure that this changes the result in a meaningful way, since a < b and !(a >= b) are completely equivalent for integers.

Here's some example code to demonstrate.

@SquishyPandaDev
Copy link
Author

SquishyPandaDev commented Dec 15, 2024

Oh dear I made a logic mistake too. And I was over thinking it too face palm. Sorry about that

The problem is this. Lets say you have 7 slaves assigned to milking and you go to add a 8th. That 8th slave will show as having an unavailable time slot. The function as is will get the current number of slaves in that job slot (8) and compare it to the max of 8. 8 < 8 returns false. No free slots.

It should be a <= b. I will change it and resubmit

Fix the player being unable to assign the maximum number of slaves to certain jobs.
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.

2 participants