-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Character::get_wielded_item
returns an item_location
#58666
Merged
Merged
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
github-actions
bot
added
[C++]
Changes (can be) made in C++. Previously named `Code`
Bionics
CBM (Compact Bionic Modules)
Code: Tests
Measurement, self-control, statistics, balancing.
Info / User Interface
Game - player communication, menus, etc.
Items: Containers
Things that hold other things
Martial Arts
Arts, Techniques, weapons and anything touching martial arts.
Mechanics: Weather
Rain, snow, portal storms and non-temperature environment
Melee
Melee weapons, tactics, techniques, reach attack
Vehicles
Vehicles, parts, mechanics & interactions
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
json-styled
JSON lint passed, label assigned by github actions
astyled
astyled PR, label is assigned by github actions
labels
Jun 24, 2022
mqrause
force-pushed
the
weapon_location
branch
2 times, most recently
from
June 24, 2022 18:47
1253043
to
c30dce5
Compare
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jun 24, 2022
github-actions
bot
added
BasicBuildPassed
This PR builds correctly, label assigned by github actions
and removed
BasicBuildPassed
This PR builds correctly, label assigned by github actions
labels
Jun 26, 2022
mqrause
force-pushed
the
weapon_location
branch
5 times, most recently
from
July 2, 2022 08:53
d0f6204
to
5459121
Compare
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jul 2, 2022
mqrause
force-pushed
the
weapon_location
branch
3 times, most recently
from
July 3, 2022 05:58
9869260
to
4f6c71c
Compare
mqrause
force-pushed
the
weapon_location
branch
2 times, most recently
from
July 8, 2022 05:20
c7f4a40
to
6357ba6
Compare
github-actions
bot
removed
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jul 8, 2022
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jul 9, 2022
Closed
dseguin
pushed a commit
that referenced
this pull request
Jul 16, 2022
* Riotbot attack: Check if wielded weapon is null before using The game would occasionally crash when in presence of a riotbot. Running a debug build of the game relvealed the cause - mattack::riotbot would use get_wielded_item()->typeId() without checking if it was actually getting an item. The function will now check the returned item_location like other code using get_wielded_item() does. References #58666 * Add parentheses to the logical expression
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
astyled
astyled PR, label is assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
Bionics
CBM (Compact Bionic Modules)
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
Code: Tests
Measurement, self-control, statistics, balancing.
Info / User Interface
Game - player communication, menus, etc.
Items: Containers
Things that hold other things
json-styled
JSON lint passed, label assigned by github actions
Martial Arts
Arts, Techniques, weapons and anything touching martial arts.
Mechanics: Weather
Rain, snow, portal storms and non-temperature environment
Melee
Melee weapons, tactics, techniques, reach attack
Vehicles
Vehicles, parts, mechanics & interactions
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.
Summary
Infrastructure "Character::get_wielded_item returns an item_location"
Purpose of change
More item_location.
Describe the solution
Change the return type and then adjust all the things while trying to not make it explode in scope.
Describe alternatives you've considered
Testing
It compiles and tests pass. I reviewed all except the test files (tests ran over a dozen times without issues) for potential nullpointer dereferences and hopefully didn't miss any. Played around in the game for like 10 minutes without crashes, but it's near impossible to test everything. But I'm fairly optimistic and any issues should be easily fixable.
Additional context
Beware of conflicts with other PRs.