View Issue Details

IDProjectCategoryView StatusLast Update
0004573Dwarf FortressReactionspublic2014-01-17 10:03
ReporterQuietust Assigned ToToady One  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSWindowsOS Version7
Product Version0.31.25 
Fixed in Version0.34.02 
Summary0004573: [MAGMA_BUILD_SAFE] reaction token does not work properly
DescriptionWhile attempting to test the behavior of the various reaction tokens, I created a test reaction which would consume any magma-safe building material.

Once I created a handful of materials (boulders of sandstone, mudstone, shale, rock salt, and limestone, plus bars of copper, silver, gold, platinum, and zinc), all of the items were available for selection, even though only 2 of the items (sandstone and platinum) were actually magma-safe.

Further testing with custom materials revealed that [MAGMA_BUILD_SAFE] appears to be behaving exactly the same as [FIRE_BUILD_SAFE], filtering out all reagents made of materials that have an IGNITE_POINT not equal to "NONE" (60001).
Steps To Reproducereaction_test

[OBJECT:REACTION]

[REACTION:MAKE_STUFF]
    [NAME:make items]
    [ADVENTURE_MODE_ENABLED]
    [PRODUCT:100:1:BOULDER:NONE:INORGANIC:SANDSTONE]
    [PRODUCT:100:1:BOULDER:NONE:INORGANIC:MUDSTONE]
    [PRODUCT:100:1:BOULDER:NONE:INORGANIC:SHALE]
    [PRODUCT:100:1:BOULDER:NONE:INORGANIC:ROCK_SALT]
    [PRODUCT:100:1:BOULDER:NONE:INORGANIC:LIMESTONE]
    [PRODUCT:100:1:BAR:NONE:INORGANIC:COPPER]
    [PRODUCT:100:1:BAR:NONE:INORGANIC:SILVER]
    [PRODUCT:100:1:BAR:NONE:INORGANIC:GOLD]
    [PRODUCT:100:1:BAR:NONE:INORGANIC:PLATINUM]
    [PRODUCT:100:1:BAR:NONE:INORGANIC:ZINC]
    [SKILL:MAGIC_NATURE]

[REACTION:USE_MAGMA_SAFE]
    [NAME:use magma-safe material]
    [ADVENTURE_MODE_ENABLED]
    [REAGENT:item:1:NONE:NONE:NONE:NONE][MAGMA_BUILD_SAFE][BUILDMAT]
    [SKILL:MAGIC_NATURE]
Tagsbinary patch

Relationships

related to 0000307 new No announcements for blistering/charring, and other fire-related problems 
related to 0005011 confirmeduser6 Material fire-safety temperature inconsistent with actual fire temperature 
related to 0005514 resolveduser11 Stones without MELTING_POINT can't be used to make magma buildings 

Activities

Quietust

2011-10-21 10:29

reporter   ~0018872

Last edited: 2011-10-22 14:28

Looking at a disassembly, the problem appears to be that ALL fire-safety and magma-safety checks are broken - they're intending to compare the material's 5 special temperatures (HEATDAM_POINT, COLDDAM_POINT, IGNITE_POINT, MELTING_POINT, and BOILING_POINT) to 11000 and 12000 (for fire and magma, respectively) but are actually checking IGNITE_POINT all 5 times, resulting in failure if it's not equal to NONE (since the first 4 checks return failure if greater than or equal, but the 5th check which was meant for COLDDAM_POINT returns failure if less than or equal).

The only noticeable effects of this bug are that the game permits you to build forges and furnaces out of non-fire-safe materials and build magma forges and furnaces out of non-magma-safe materials.

A brief look at a disassembly of the fire/magma-safety check from version 0.28.181.40d suggests that this has ALWAYS been broken...

Quietust

2011-10-22 14:09

reporter   ~0018879

Binary patch for version 0.31.25 Win32 SDL:
6246CC : 76 -> 78
6246E7 : 76 -> 7A
62471D : 76 -> 72
62472E : 76 -> 74

Rhenaya

2011-10-22 17:49

reporter   ~0018880

on an unrelated sidenote: the make stuff makes broken bars: it should be BARS:NONE:METAL:x instead of inorganic, some reaction will not use the inorganic bars

Quietust

2011-10-22 19:52

reporter   ~0018882

Last edited: 2011-10-22 19:54

Rhenaya: that is incorrect - in 0.31.xx, METAL is nothing more than an alias for INORGANIC, since MATGLOSS_STONE and MATGLOSS_METAL from 0.28.181.40d were merged together. The only reason the above reaction would produce "broken" bars is because I didn't specify [PRODUCT_DIMENSION:150] for each one, and that's because I really didn't care what size they were - after all, it was just an Arena mode test.

Quietust

2012-01-23 19:54

reporter   ~0019420

I can see this being related to 0005011, but it really has nothing to do with how temperatures actually interact with materials (and tissue layers, as in 0000307), just with how items are classified by certain workshop/building jobs...

Quietust

2012-02-01 10:15

reporter   ~0019446

Binary patch for version 0.31.25 Linux: (untested)
98F786 : 16 -> 18
98F7B8 : 16 -> 1A
98F802 : 16 -> 12
98F823 : 16 -> 14

Toady One

2012-02-16 16:31

administrator   ~0019857

It's especially funny seeing all the ignites in the code there... thanks to Quietust for this one. Fixed for next time.

Issue History

Date Modified Username Field Change
2011-04-25 08:51 Quietust New Issue
2011-10-21 10:29 Quietust Note Added: 0018872
2011-10-21 10:47 Quietust Note Edited: 0018872
2011-10-21 16:55 Quietust Note Edited: 0018872
2011-10-22 14:09 Quietust Note Added: 0018879
2011-10-22 14:15 Quietust Note Edited: 0018872
2011-10-22 14:28 Quietust Note Edited: 0018872
2011-10-22 17:49 Rhenaya Note Added: 0018880
2011-10-22 19:52 Quietust Note Added: 0018882
2011-10-22 19:53 Quietust Note Edited: 0018882
2011-10-22 19:54 Quietust Note Edited: 0018882
2011-11-25 19:56 Quietust Tag Attached: binary patch
2012-01-22 08:01 user6 Relationship added related to 0000307
2012-01-23 19:54 Quietust Note Added: 0019420
2012-02-01 10:15 Quietust Note Added: 0019446
2012-02-01 10:33 user6 Relationship added related to 0005011
2012-02-16 16:31 Toady One Note Added: 0019857
2012-02-16 16:31 Toady One Status new => resolved
2012-02-16 16:31 Toady One Fixed in Version => Next Version
2012-02-16 16:31 Toady One Resolution open => fixed
2012-02-16 16:31 Toady One Assigned To => Toady One
2012-02-29 20:17 user6 Relationship added related to 0005514