CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.33k stars 4.14k forks source link

Circular Saw Activation Destroys Battery Mods #42854

Closed Grubleafeater closed 4 years ago

Grubleafeater commented 4 years ago

Describe the bug

When you turn on a circular saw that has a battery mod, it loses that battery mod and ejects the battery.

Steps To Reproduce

Give a circular saw a heavy or light battery mod.

Load in a battery with at least 5 charge

Turn on circular saw

Expected behavior

Saw should maintain battery mod and function.

Screenshots

Versions and configuration

Additional context

wapcaplet commented 4 years ago

Confirmed. Here I have modded a circular saw with a heavy battery mod, and loaded in a new battery:

image

Turning the saw on makes the battery and the +1 attribute disappear:

image

The same behavior occurs with several other battery-powered items, including:

These were working as of PR #41917

Version info:

wapcaplet commented 4 years ago

Running a git bisect reveals that this bug was introduced by commit e6db6e29875, the squashed changes from #42442

ZhilkinSerg commented 4 years ago

Running a git bisect reveals that this bug was introduced by commit e6db6e2, the squashed changes from #42442

4a92d5862df3948fc933f095d9b26500eb81e1e4 is the first bad commit
commit 4a92d5862df3948fc933f095d9b26500eb81e1e4
Author: Qrox <qrox@sina.com>
Date:   Fri Jul 24 23:56:29 2020 +0800

    Update pocket data during item conversion

 src/item.cpp       | 3 +++
 src/iuse_actor.cpp | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
wapcaplet commented 4 years ago

This looks very similar and may be a duplicate of #42764