Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Spawn triggered bear trap only after creature escapes from it

Open Night-Pryanik opened this issue 1 year ago • 2 comments

Summary

Bugfixes "Spawn triggered bear trap only after creature escapes from it"

Purpose of change

Closes #64587.

Describe the solution

Spawn triggered bear trap only after creature escapes from it, not after trap's trigger. This forbids picking up and other means of interacting with triggered trap until you're freed from it.

Describe alternatives you've considered

Convert bear trap into an "armor" which will be forcefully worn on affected limb (like a splint) on trigger, and be very hard to remove, and may even lead to a removal of a limb, as stated in comments: https://github.com/CleverRaven/Cataclysm-DDA/blob/bbf007713d444a6477bacdb3276190de97b3d22c/src/character_escape.cpp#L89-L91 This is a preferred solution, but obviously it would require much more work to implement it properly.

Testing

Got caught in a trap. No trap (both as a trap and as as item) on the ground. Tried to free. After escape, triggered bear trap is spawned on character's location.

Additional context

None.

Night-Pryanik avatar Sep 09 '24 16:09 Night-Pryanik

Does it changes how it behaves for monsters?

SariusSkelrets avatar Sep 09 '24 21:09 SariusSkelrets

No, monster interaction with bear trap remains the same. This PR affects only character-trap interaction.

Night-Pryanik avatar Sep 10 '24 08:09 Night-Pryanik