Bugfix: Prevent empty subject in 'but do no damage' msgs when dealing no damage #68261
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
Bugfixes "Prevent empty subject in 'but do no damage' msgs when dealing no damage"
Purpose of change
but do no damage
(sic) without theYou hit the zombie
-part.melee_message
tries to determine which damage type does the most damage0
damage on all damage types, it would selectdamage_type_id::NULL_ID
as the type of damage being dealt.You poke the zombie
,You cut the zombie
orYou hit the zombie
picked none of them, thus displaying the broken attack messages.Describe the solution
You hit the zombie
+but do no damage
Describe alternatives you've considered
Testing
Before:
![bugfix-empty-monstername-when-hitting-no-damage-before](https://private-user-images.githubusercontent.com/123803852/270055823-803d704e-5e30-41f4-b648-372919411a47.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NzEwODMsIm5iZiI6MTczOTU3MDc4MywicGF0aCI6Ii8xMjM4MDM4NTIvMjcwMDU1ODIzLTgwM2Q3MDRlLTVlMzAtNDFmNC1iNjQ4LTM3MjkxOTQxMWE0Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQyMjA2MjNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kODYwMzQyNzQzMmY1MWY3MWFjZDZkNTk3Y2U2YmUxNDRkMzNmNWI1M2ZkOTI0NjI3OGVmMWY5YTJkNmVlNWY2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.paxHJvyAJQQqSEIoRUCGJXTcWdugzpHkof2VIu8an1I)
After:
![bugfix-empty-monstername-when-hitting-no-damage-after](https://private-user-images.githubusercontent.com/123803852/270055856-cdc55540-67bf-4dec-b2aa-8389b6597fbc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NzEwODMsIm5iZiI6MTczOTU3MDc4MywicGF0aCI6Ii8xMjM4MDM4NTIvMjcwMDU1ODU2LWNkYzU1NTQwLTY3YmYtNGRlYy1iMmFhLTgzODliNjU5N2ZiYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQyMjA2MjNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00YTdkZmQyOTJjODZhYTM5NWM0NDNmNGY3MmRiYjgwNDM0OGJmZThjMWE1OTZiYjYwYTJjN2Y0ODVlOTU2ZDY4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.qtQyEI2i9DbrzASOEeZ9EAtOelyD2ruFXgSWWCWWbls)
Additional context