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

Character::get_wielded_item returns an item_location #58666

Merged
merged 1 commit into from
Jul 9, 2022

Conversation

mqrause
Copy link
Contributor

@mqrause mqrause commented Jun 24, 2022

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.

@github-actions 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 mqrause force-pushed the weapon_location branch 2 times, most recently from 1253043 to c30dce5 Compare June 24, 2022 18:47
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 24, 2022
@mqrause mqrause marked this pull request as ready for review June 26, 2022 21:28
@mqrause mqrause requested a review from KorGgenT as a code owner June 26, 2022 21:28
@github-actions 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 mqrause force-pushed the weapon_location branch 5 times, most recently from d0f6204 to 5459121 Compare July 2, 2022 08:53
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 2, 2022
@mqrause mqrause force-pushed the weapon_location branch 3 times, most recently from 9869260 to 4f6c71c Compare July 3, 2022 05:58
@mqrause mqrause force-pushed the weapon_location branch 2 times, most recently from c7f4a40 to 6357ba6 Compare July 8, 2022 05:20
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 8, 2022
@mqrause mqrause force-pushed the weapon_location branch from 6357ba6 to 9ada1c5 Compare July 8, 2022 15:30
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 9, 2022
@dseguin dseguin merged commit 979718d into CleverRaven:master Jul 9, 2022
@mqrause mqrause deleted the weapon_location branch July 9, 2022 06:05
@nik-ovchin nik-ovchin mentioned this pull request Jul 10, 2022
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants