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

Bugfix: Prevent empty subject in 'but do no damage' msgs when dealing no damage #68261

Conversation

inogenous
Copy link
Contributor

Summary

Bugfixes "Prevent empty subject in 'but do no damage' msgs when dealing no damage"

Purpose of change

  • Addresses one part of Grab messages may be inaccurate and subject is blank #67290 .
  • Fixes an issue where hitting an enemy without doing damage would show but do no damage (sic) without the You hit the zombie-part.
  • The issue before was:
    • The method melee_message tries to determine which damage type does the most damage
    • But if the attack does 0 damage on all damage types, it would select damage_type_id::NULL_ID as the type of damage being dealt.
    • This meant that the code that determines whether to display You poke the zombie, You cut the zombie or You hit the zombie picked none of them, thus displaying the broken attack messages.

Describe the solution

Describe alternatives you've considered

  • Another option would be to pick a random damage type

Testing

Before:
bugfix-empty-monstername-when-hitting-no-damage-before

After:
bugfix-empty-monstername-when-hitting-no-damage-after

Additional context

* Fixes an issue where hitting an enemy without doing damage would show ` but do no damage` (sic) without the `You hit the zombie`-part.
* The issue before was:
	* The method `melee_message` tries to determine which damage type does the most damage
	* But if the attack does `0` damage on all damage types, it would select `damage_type_id::NULL_ID` as the type of damage being dealt.
	* This meant that the code that determines whether to display `You poke the zombie`, `You cut the zombie` or `You hit the zombie` picked none of them, thus displaying the broken attack messages.
* This change therefore defaults to bashing damage if none of the other damage types deals any damage, so that the message displayed will be `You hit the zombie`+` but do no damage`
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Melee Melee weapons, tactics, techniques, reach attack <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Sep 22, 2023
@Maleclypse Maleclypse merged commit d0e349e into CleverRaven:master Sep 23, 2023
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 <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions Melee Melee weapons, tactics, techniques, reach attack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants