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

Consume the sheet of glass when placing a glass shards trap #33465

Conversation

pierredavidbelanger
Copy link
Contributor

@pierredavidbelanger pierredavidbelanger commented Aug 22, 2019

Summary

SUMMARY: Bugfixes "Placing a glass shards trap now consumes the sheet of glass"

Purpose of change

Fixes #33124 - Using sheet of glass doesn't consume it

Describe the solution

In player.cpp, after actually_used->type->invoke( ... ), when we check if we consume_charges( ... ) or i_rem( ... ), I added a condition that if method == "place_trap" we i_rem( ... )

Describe alternatives you've considered

Since the condition already works when we place traps from items of type TOOL, I considered changing (in the JSON) item glass_sheet to be of type TOOL instead of GENERIC, that would resolve the issue without code, but it does not make sens, a sheet of glass is not really a tool :)

Additional context

@pierredavidbelanger pierredavidbelanger changed the title fix #33124 , now sheet of glass is consumed after being placed as a trap Consume the sheet of glass when placing a glass shards trap Aug 22, 2019
@ZhilkinSerg ZhilkinSerg added <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. labels Aug 22, 2019
@ZhilkinSerg ZhilkinSerg merged commit c00f585 into CleverRaven:master Aug 22, 2019
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.

Using sheet of glass doesn't consume it
2 participants