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

Contained fires will burn through all its items continuously #21418

Merged
merged 4 commits into from Jul 27, 2017

Conversation

Projects
None yet
5 participants
@AlecWhite
Copy link
Contributor

commented Jul 14, 2017

Making a fire in braziers/wooden stoves/anything with fire container flag, will fully burn all of its items continuously.

I found weird that you had to relight a log in a brazier, when in real life you would have make sure to light the log in such a way that it burns all of it.
This helps adding importance to wood cutting tools, and fire containers, as for now they were only used for a 1-2 turn between you light the fire and use it for crafting.
It adds further usefulness to tree cutting and tree cutting tools as it can be used as a source of light for reading/craft, etc, as it would do in real life.

Also thanks Coolthulhu for helping me to understand how fire works.

if( bd.chance_in_volume == 0 || bd.chance_in_volume >= vol ||
x_in_y( bd.chance_in_volume, vol ) ) {
// If fire is contained, burn all of it continously
if( !can_spread ) {

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Jul 14, 2017

Contributor

Merge that if with the one below, as in:

if( !can_spread || bd.chance_in_volume == 0 ||
src/item.h Outdated
@@ -354,7 +356,7 @@ class item : public JsonSerializer, public JsonDeserializer, public visitable<it
std::string info( bool showtext, std::vector<iteminfo> &dump ) const;

/** Burns the item. Returns true if the item was destroyed. */
bool burn( fire_data &bd );
bool burn( fire_data &bd, bool can_spread = false );

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Jul 14, 2017

Contributor

The second argument shouldn't default to anything.

This comment has been minimized.

Copy link
@AlecWhite

AlecWhite Jul 14, 2017

Author Contributor

Made can_spread optional because burn() is called for when the player enters a fire and burns its clothes.
Should I make a burn_clothes() that calls burn() with a bool?

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Jul 14, 2017

Contributor

Just supply the correct argument there, don't default. burn(thing, false)

Though you also should change the argument from can_spread to something like contained. It would make it more informative and also cover the player burning example better.

src/item.h Outdated
@@ -21,6 +21,8 @@
#include "debug.h"
#include "units.h"
#include "cata_utility.h"
#include "mapdata.h"
#include "map.h"

This comment has been minimized.

Copy link
@BevapDin

BevapDin Jul 14, 2017

Contributor

Why? Also why mapdata.h?

@EricFedrowisch

This comment has been minimized.

Copy link
Contributor

commented Jul 23, 2017

Thank you SO much! I use the brazier almost exclusively at the start of the game. It will be great if I don't have to light the brazier every time I finish a recipe. Right now it seems like I need to light a fire 3-5 times before it consumes the fuel.

@kevingranade kevingranade merged commit 18c9885 into CleverRaven:master Jul 27, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
gorgon-ghprb Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.