-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
Refactor script_game_object
money functions to use u32
#1479
Open
AMS21
wants to merge
3
commits into
OpenXRay:dev
Choose a base branch
from
AMS21:refactor/script_game_object_money
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So, does that fix #1173 by the way? |
Xottab-DUTY
added
Bug
The issue in the run-time.
Code Quality
good first issue
Good start for beginners that want to contribute.
labels
Oct 26, 2023
wow |
Well not really. You don't get negative money. The money transfer just does not happen but the dialog still works and you get the information just without losing money. It does produce a LUA error now so the check definitely works:
|
AMS21
force-pushed
the
refactor/script_game_object_money
branch
from
November 17, 2023 14:12
b73f6b6
to
d8f3f00
Compare
AMS21
force-pushed
the
refactor/script_game_object_money
branch
from
November 25, 2023 13:03
d8f3f00
to
5d659b7
Compare
Any objections to getting this merged? :) |
AMS21
force-pushed
the
refactor/script_game_object_money
branch
from
December 4, 2023 11:00
5d659b7
to
7caa28f
Compare
Xottab-DUTY
force-pushed
the
dev
branch
2 times, most recently
from
December 16, 2023 10:39
143d1ca
to
118d39d
Compare
Xottab-DUTY
force-pushed
the
dev
branch
2 times, most recently
from
May 4, 2024 03:27
5b2ec76
to
6fffce9
Compare
Since `CInventoryOwner` also uses `u32` for its `money` member
Since both values are unsigned subtracting them from another will never produce a negative value. This bug was also present before the previous commit since the `money` variable was implicitly converted to an `u32` resulting in the same bug.
AMS21
force-pushed
the
refactor/script_game_object_money
branch
from
May 14, 2024 16:21
7caa28f
to
9238c63
Compare
Xottab-DUTY
force-pushed
the
dev
branch
2 times, most recently
from
October 24, 2024 02:36
e89fcc8
to
f6fd5cc
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
The issue in the run-time.
Code Quality
good first issue
Good start for beginners that want to contribute.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since
CInventoryOwner
already storedmoney
as au32
it only makes since for us to also treat it like one.Also fixed a logic bug which would have allowed the object to transfer money which it didn't have.
Since both values are unsigned subtracting them from another will never
produce a negative value.
This bug was also present before changing the function signature since the
money
variable was implicitly converted to an
u32
resulting in the same problem.