CleverRaven / Cataclysm-DDA

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

Problem with grain stook #68797

Closed watcherPlayer closed 11 months ago

watcherPlayer commented 12 months ago

Describe the bug

drying cereal stalks through a 'Stooking spot' does not work correctly, after drying all cereals have zero calories, but if you dry them through the crafting system (shift + 7) everything is fine

Attach save file

None

Steps to reproduce

  1. create 'Stooking spot'
  2. put cereal stalks (i try on wheat, wild rice and buck wheat)
  3. activate grain stook
  4. wait two weeks
  5. activate ready grain stook

Expected behavior

calories > 0

Screenshots

grain_stook wharf buckwheat wild_rice

Versions and configuration

Additional context

No response

PatrikLundell commented 12 months ago

Is this related to the issue with milling (caused by charge removal)?

fairyarmadillo commented 12 months ago

It's because of the charge removal. The following code in iexamine.cpp covers it:

for( item &it : items ) { if( it.has_flag( flag_SMOKABLE ) && it.get_comestible() ) { item result( it.get_comestible()->smoking_result, it.birthday(), it.charges ); recipe rec; result.inherit_flags( it, rec ); if( !result.has_flag( flag_NUTRIENT_OVERRIDE ) ) { // If the item has "cooks_like" it will be replaced by that item as a component. if( !it.get_comestible()->cooks_like.is_empty() ) { // Set charges to 1 for stacking purposes. it = item( it.get_comestible()->cooks_like, it.birthday(), 1 ); } result.components.add( it ); result.recipe_charges = it.charges; } addmsg( ( "You take down the stook as the drying process is now finished." ) ); it = result; } }

That just needs to be changed from charges to count.

edit: looks like github's code pasting is broken? Sorry about the formatting, but that's the code. iexamine.cpp 3151