-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
1 ml of gasoline burns for 14 hours #73735
Comments
Confirmed
|
/Confirm
|
Well, the resulting fire values are being multiplied a random number between 100 and 200. That's accounting for the Line 11811 in 81ede3c
I can confirm the behavior is different in 0.G though. item::simulate_burn hasn't changed since the 0.G branch, so something must have changed elsewhere. I went through the field processor, item::burn, even the firestarter actor... didn't find any obvious cause. |
I've bisected it to probably #73069 (yep, also me!). April 28: no issues, may 1st: issue. That PR was merged on the 29th and touched related code, so it is by far the most likely candidate. ...I am not finding the reason for this change in behavior, though. |
Maybe some code is adding field with infinite duration? |
Could this be related with #73495? |
Okay. This is complicated. You can observe the change in behavior by adding the INCENDIARY ammo_effect back onto gasoline. Removing IGNITE is not sufficient - it must have the INCENDIARY tag. (This little fact tripped me up when initially testing) Having INCENDIARY ammo_effect at all causes the Cataclysm-DDA/src/item_factory.cpp Lines 407 to 408 in 731bdaa
Because it cooks off, it returns true in item::will_explode_in_fire(), causing the item to be erased when the fire field processes it (the processor assumes it exploded, regardless of whether or not it did) and does not pass it on to be considered a 'fuel'. Cataclysm-DDA/src/map_field.cpp Line 972 in 731bdaa
Cataclysm-DDA/src/map_field.cpp Line 986 in 731bdaa
Because it is not considered a fuel, it does not simulate burn. Note that item::burn is passed fire_data as a reference, and it modifies that fire_data directly. Cataclysm-DDA/src/map_field.cpp Line 991 in 731bdaa
But now that is not INCENDIARY and not "blowing up", it does get passed into item::simulate_burn() which has that previously mentioned behavior with charges. Also item::burn() itself is setting a huge negative number of charges (which itself should not be possible). There are many, many parts here that are working counterintuitively. TL;DR: the game previously assumed it "blew up" and discounted it as fuel. The simplest way to resolve this is probably to force IGNITE ammos to cookoff (diff below). This will restore the old behavior, but does not actually change the calculations which were giving crazy results. It merely goes back to skipping those calculations. index 7c883c125b..3912921216 100644
--- a/src/item_factory.cpp
+++ b/src/item_factory.cpp
@@ -405,6 +405,7 @@ void Item_factory::finalize_pre( itype &obj )
mats.find( material_oil ) == mats.end() ) {
const auto &ammo_effects = obj.ammo->ammo_effects;
obj.ammo->cookoff = ammo_effects.count( "INCENDIARY" ) > 0 ||
+ ammo_effects.count( "IGNITE" ) > 0 ||
ammo_effects.count( "COOKOFF" ) > 0;
static const std::set<std::string> special_cookoff_tags = {{
"SPECIAL_COOKOFF"
|
Describe the bug
While trying to learn about fire, I dropped a unit of gasoline and set fire to the tile containing it, it created a raging fire that lasted 14 hours.
Attach save file
N/A
Steps to reproduce
Expected behavior
I expected that fire would last reasonably, similar to 0.G (about 7 minutes).
Screenshots
No response
Versions and configuration
Additional context
No response
The text was updated successfully, but these errors were encountered: