-
Notifications
You must be signed in to change notification settings - Fork 310
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
base: master
Are you sure you want to change the base?
paycheckRework #710
Conversation
There was a problem hiding this 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
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.] |
There was a problem hiding this comment.
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 };
There was a problem hiding this comment.
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.
Changes proposed in this pull request:
Changing the paychecks to a rank based approach
I have tested my changes and corrected any errors found