Fix TestSuicideByHeldItem and TestSuicideByHeldItemSpreadDamage #33030
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.
About the PR
When
Content.Shared.Atmos.Atmospherics.LowPressureDamage
is set to anything other than 1 or 0TestSuicideByHeldItem
andTestSuicideByHeldItemSpreadDamage
fail assertions of damage done.With
LowPressureDamage = 4
The tests are fine with
Atmospherics.LowPressureDamage = 1
due to rounding up to next integer (199.5->200) which is why this issue was not spotted sooner.I've noticed that tests fail only on full or expanded test runs.
Example:
--filter SuicideCommandTests
passes,--filter Commands
fails.The test player must take a tick of barotrauma damage at some point.
Healing all damage before running the command and the damage assertions fixes the issue.
Special thanks to @SlamBamActionman for tracking down the bug.
Why / Balance
Bug fix. Needed downstream due to changed low pressure damage.
Technical details
DamageableSystem.SetAllDamage()
to 0 before running the commands and asserting the damage.Media
N/A
Requirements
Breaking changes
N/A
Changelog
Not player facing