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

Charcoal kiln unacceptable pocket error #59189

Open
Merikona opened this issue Jul 12, 2022 · 9 comments
Open

Charcoal kiln unacceptable pocket error #59189

Merikona opened this issue Jul 12, 2022 · 9 comments
Labels
(S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Merikona
Copy link
Contributor

Describe the bug

DEBUG : tried to put an item (charcoal) count (2080) in a container (fake_char_kiln) that cannot contain it: pocket unacceptable because tried to put too many charges of ammo in item

FUNCTION : ret_val item::put_in(const item&, item_pocket::pocket_type, bool)
FILE : src/item.cpp
LINE : 1479
VERSION : fa6f25b

Steps to reproduce

With charcoal kiln and smoking rack in close proximity, and 91 charcoal already in the smoking rack, have charcoal kiln produce more charcoal from 2 logs input. Examine the charcoal kiln when finished, then examine again.

Expected behavior

Examining the kiln shouldn't attempt to move the charcoal at all. If moved, then the correct amount should be moved to the smoking rack, that's below its capacity limit.

Screenshots

image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19044.1766 (21H2)
  • Game Version: fa6f25b [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    No Fungal Growth [no_fungal_growth],
    Bionic Professions [package_bionic_professions]
    ]

Additional context

Aventura.zip

@Merikona Merikona added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Jul 12, 2022
@PatrikLundell
Copy link
Contributor

PatrikLundell commented Jul 12, 2022

/confirmed

I don't believe it has anything to do with moving items as such. I get this reliably reproducible error whenever I examine my charcoal kiln at the Kitchen base camp expansion (version 2, although version 1 looks the same in this area) to finish the production process and then access any smoking rack without having moved the charcoal away from the kiln (I keep my smoking racks reasonably topped up with charcoal).
It can be noted that it's been present for a long time, so it's not a new phenomenon. Since it doesn't seem to produce any problems, I've always found an excuse to put off reporting the issue until later...

@mqrause
Copy link
Contributor

mqrause commented Jul 12, 2022

/confirmed

I guess editing in the confirmation doesn't work.

@github-actions github-actions bot added (S2 - Confirmed) Bug that's been confirmed to exist and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Jul 12, 2022
@mqrause
Copy link
Contributor

mqrause commented Nov 28, 2022

I can't reproduce this on 4034a38, does it still happen with some more complicated reproduction steps?

@PatrikLundell
Copy link
Contributor

Still there for me:
DEBUG : tried to put an item (charcoal) count (2400) in a container (fake_char_kiln) that cannot contain it: pocket unacceptable because tried to put too many charges of ammo in item

FUNCTION : put_in
FILE : C:\Cataclysm-DDA\src\item.cpp
LINE : 1501
VERSION : 0.F-12577-g4034a38d4b-dirty
where the "dirty" part is caused by added recipes to bare bones base camp.

Steps for me:

  1. Walk to charcoal kiln.
  2. Wait two hours to finish the coal production process (in process in the save used).
  3. Examine the kiln to finish the process and "release" the charcoal.
  4. Move 1 step south to be adjacent to the charcoal smokers.
  5. 'e'xamine the charcoal smoker to the south.
  6. Get message above.

The kiln and the smokers are all within a base camp storage area, but not part of any base camp blueprint (bare bones base camp). It can also be noted that dismissing the debug message with space (i.e. single time dismiss) still doesn't allow the message to appear again when 'e'xamining that (or an adjacent) smoking rack, indicating there is some condition that's generated by "releasing" the charcoal in the kiln that's triggered only by the examination of the smoker, but that this condition is resolved at that time. I avoid the annoying messages by moving the charcoal away from the kiln directly after "releasing" it.

Neither a rock forge nor a bloomery causes the message to appear when 'e'xamined after "releasing" the charcoal in the kiln. These two are at some 15 or so tiles distance (in particular, more than the 6 of the crafting interaction distance).

Save with .mm1 folder removed: Walk to the SE to get to the kiln to the N of the row of smokers:
Indialantic - Copy.zip

@mqrause
Copy link
Contributor

mqrause commented Nov 28, 2022

if( item *furn_item = provide_pseudo_item( f.crafting_pseudo_item, 0 ) ) {
const itype *ammo = f.crafting_ammo_item_type();
if( furn_item->has_pocket_type( item_pocket::pocket_type::MAGAZINE ) ) {
// NOTE: This only works if the pseudo item has a MAGAZINE pocket, not a MAGAZINE_WELL!
const bool using_ammotype = f.has_flag( ter_furn_flag::TFLAG_AMMOTYPE_RELOAD );
int amount = 0;
itype_id ammo_id = ammo->get_id();
// Some furniture can consume more than one item type.
if( using_ammotype ) {
amount = count_charges_in_list( &ammo->ammo->type, m.i_at( p ), ammo_id );
} else {
amount = count_charges_in_list( ammo, m.i_at( p ) );
}
item furn_ammo( ammo_id, calendar::turn, amount );
furn_item->put_in( furn_ammo, item_pocket::pocket_type::MAGAZINE );
}
}

It's this block's fault, called when forming a crafting inventory. It seems kinda off in more ways than an unsafe put_in, though.

const bool has_coal_in_inventory = you.crafting_inventory().charges_of( itype_charcoal ) > 0;

It's also kind of overkill for the smoker examine to form a crafting inventory just to check if there is any charcoal nearby, although I imagine there are more ways to trigger this error, so adjusting that would only be partially helpful.

Since the worst this error can do is be annoying, I won't fix it specifically. The error will go away when charges get removed, although it's another thing I have to keep in mind for #60885.

@MrHrulgin
Copy link
Contributor

This error did not go away when charges got removed. I refueled a camp forge and got the same error when I went back to examine the bulletin board.

DEBUG : tried to put an item (charcoal) count (1940) in a container (fake_forge) that cannot contain it: pocket unacceptable because tried to put too many charges of ammo in item

FUNCTION : put_in
FILE : D:\a\Cataclysm-DDA\Cataclysm-DDA\src\item.cpp
LINE : 1629
VERSION : 2a67568

@Veskaida
Copy link
Contributor

Veskaida commented Sep 17, 2024

Encountering a similar issue with "Smoking Rack", so unsure if this is the same issue, the bug has returned, or was never fully resolved. I recall playing builds of CDDA experimental ~12 months ago without this issue, so I think a recent change has re-implemented it. I think the issue can be artificially resolved by not placing more than the appropriate amount of fuel (2,000 units of Charcoal for a Smoking Rack) into a Smoking Rack manually. but haven't tested extensively.

Screenshot 2024-09-17 064137

Windows 11
CDDA ver c73e4c6 64 bit tiles
CDDA Experimental build 2024-09-10-0339
English
Magiclysm, Magiclysm Expansion, SpeedyDex, Stats from Kills
Catapult Launcher Winx64 24.07a

@PatrikLundell
Copy link
Contributor

This error has persisted for a fair while. As far as I can tell, it happens when you top up a smoking rack, at which point the game places more charcoal into it than it can hold if you've got enough at the source. I think the maximum capacity is 90000 currently (the size of the charges was changed at some point, I think).
Emptying and then reloading ought to get rid of the error report, although I haven't bothered to try.

@NetSysFire
Copy link
Member

Can confirm, too. Alternate reproduction steps:

  1. Be naked.
  2. Debug edit in a charcoal kiln, give yourself some matches or something and 5 logs.
  3. Stock charcoal kiln with logs and activate it.
  4. Spawn and equip wicker backpack.
  5. Wait until the kiln finished burning the charcoal.
  6. Inspect the filled kiln.
  7. Pick up as many as you can. It is going to be 3000.
  8. Open your inventory and examine the charcoal (hover over it and press e)
 DEBUG    : tried to put an item (charcoal) count (27000) in a container (fake_char_kiln) that cannot contain it: pocket unacceptable because tried to put too many charges of ammo in item

 FUNCTION : ret_val<void> item::put_in(const item&, pocket_type, bool, Character*)
 FILE     : src/item.cpp
 LINE     : 1808
 VERSION  : cdda-experimental-2024-11-16-1726 4a03734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

6 participants