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

Fix trap's trigger_weight being ignored if less than 500g #46872

Merged
merged 1 commit into from
Jan 22, 2021

Conversation

BrettDong
Copy link
Member

Summary

SUMMARY: Bugfixes "Fix trap's trigger_weight being ignored if less than 500g"

Purpose of change

The code block for triggering a trap by item is only entered when item weight is greater than 500 grams. Hence trigger_weight JSON field is not respected when its value is less than 500 grams, e.g. bear traps whose trigger_weight is 200 grams.

Fix #41538.

Describe the solution

Move the code block out from the branch whose condition is item weight greater than 500 grams.

Describe alternatives you've considered

None yet.

Testing

  1. Deploy a bear trap
  2. Throw a pebble (100 grams) to the trap and the trap is not triggered.
  3. Throw a cellphone (270 grams) to the trap and the trap is triggered.
  4. Throw a laptop (3.32 kg) to the trap and the trap is triggered.

However, in master branch version, throwing a cellphone (270 grams) does not trigger the bear trap, which disobeys trigger_weight of bear traps.

@BrettDong BrettDong added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. labels Jan 19, 2021
@ZhilkinSerg ZhilkinSerg merged commit 3ca62f6 into CleverRaven:master Jan 22, 2021
@BrettDong BrettDong deleted the trap branch January 22, 2021 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trap trigger_weight json filed is ignored
2 participants