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

paycheckRework #710

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Edward-Bakker
Copy link
Contributor

Changes proposed in this pull request:

  • Changing the paychecks to a rank based approach

  • I have tested my changes and corrected any errors found

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

wrong type definition of array for paycheck

Comment on lines 129 to 131
paycheck_cop = 500; //Payment for cops
paycheck_cop = [500,550,600,650,700,750,800,850]; //Payment for cops, increases with rank [rank 0, rank 1, rank 2, etc.]
paycheck_civ = 350; //Payment for civillians
paycheck_med = 450; //Payment for medics
paycheck_med = [450,500,550,600,650,700]; //Payment for medics, increases with rank [rank 0, rank 1, rank 2, etc.]
Copy link

@ghost ghost Jun 9, 2020

Choose a reason for hiding this comment

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

Well, another one of those "the engine gut us again" things.
I noticed that my cops got $0 as paycheck and suddenly their bank accounts were also at $0. This reminded me of the pickupMoney bug where CASH got nil at some point - and sure it's the same issue here. I tested quite a bit, but in the end it came down to that for what ever reason paycheck_cop and paycheck_med are neither an array nor a number but rather a text (I tested this by unrolling the LIFE_SETTINGS macro and tested with isArray, isNumber and isText to see what it really was I got returned - not sure if this would had been possible by using typeName or such).
Then I looked at the other arrays in the config and spotted the issue: In the config an array has to be defined with the brackets after the variable name and the values have to be enclosed in curly braces:

paycheck_cop[] = { 500, 550, 600, 650, 700, 750, 800, 850 };
paycheck_med[] = { 450, 500, 550, 600, 650, 700 };

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! Should be fixed in the latest commit.

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