Cataclysm-dda: Refilling a vehicle with two objects stored in the same item in your inventory causes a bug.

Created on 6 Jul 2020  路  5Comments  路  Source: CleverRaven/Cataclysm-DDA

Describe the bug

Trying to refill my Food Truck from my pot of gasoline results in an error (But the vehicle is indeed refilled after ignoring the error). This error also occurs if I store the gasoline in another container...
After some testing, this bug seems to only occur if I have 2 objects stored in a same item (or pocket?) in my inventory, if I drop one of the two (The paper wrapper in the save), the bug appears no more.

Steps To Reproduce

  1. Load the save
  2. Try to refill the Food Truck
  3. See an error
  4. Drop the paper wrapper
  5. Try to refill again the Food Truck
  6. No more bug

Expected behavior

To refill my vehicle without errors happening every time.

Versions and configuration

  • OS: Windows

    • OS Version: 10.0 1903

  • Game Version: 0.E-3770-g879889a [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Whaleys Hair Mod [WHALEYHAIR1],
    Magiclysm [magiclysm],
    Mythical Martial Arts [MMA],
    SpeedyDex [speedydex],
    Stats Through Kills [stats_through_kills]
    ]

Additional context

The bug also seems to make the game believe I have gasoline stored in the item in which I have two items, since it gives me the option to refill from there... If you select that option, the game tries to refill the vehicle with whatever you have stored in there (DEBUG: tried to put an item (Thorazine) in a container (metal_tank) that cannot contain it).
Oh, and the vehicle is "Completely refilled" after you try to refill it if it gives you the error.

error report:

DEBUG : ERROR: item_contents::only_item called with 2 items contained

FUNCTION : const item& item_contents::only_item() const
FILE : src/item_contents.cpp
LINE : 851

Foodville.zip

<Bug> Containers Vehicles

Most helpful comment

I can reproduce this error, by attempting to fill a vehicle gasoline tank from a steel jerrycan of gasoline, while wearing any article of clothing with more than 1 item in its pockets.

  1. Get a gasoline-powered vehicle, and a jerrycan of gasoline
  2. Take off all clothing, except 1 item with at least 2 things in its pockets
  3. examine the vehicle, and try to fill a tank with gasoline - error item_contents::only_item called with 2 items contained (this is referring to your clothing with 2 things in the pockets)
  4. Skip the error - you can proceed with filling the tank
  5. Now, remove all but 1 item from your clothing pockets
  6. examine and try to fill again - no errors

Here, I have attempted to fill a beetle's gas tank while wearing jeans with 3 items in them. The error:

image

After skipping the error, I am prompted which inventory item to fill the tank with. The jerrycan is there, which is good - but I can also select the jeans:

image

If I choose to fill the tank from the jeans, one of the items disappears from the jeans (a cell phone), and I get a message that the tank has been refilled (though it hasn't):

image

I can do this with items from any of my pockets. If I have a backpack full of bricks, I can fill the gas tank with bricks from the backpack.

  • OS: Linux

    • OS Version: Distributor ID: Pop; Description: Pop!_OS 20.04 LTS; Release: 20.04; Codename: focal;

  • Game Version: 0.E-4941-gd04c8c6f19 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food]
    ]

All 5 comments

This is an issue mentioned in PR #41439

It will continue until the check is no longer bypassed by the container system.

This is an issue mentioned in PR #41439

It will continue until the check is no longer bypassed by the container system.

Oh, then good, at least the issue is known.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

I can reproduce this error, by attempting to fill a vehicle gasoline tank from a steel jerrycan of gasoline, while wearing any article of clothing with more than 1 item in its pockets.

  1. Get a gasoline-powered vehicle, and a jerrycan of gasoline
  2. Take off all clothing, except 1 item with at least 2 things in its pockets
  3. examine the vehicle, and try to fill a tank with gasoline - error item_contents::only_item called with 2 items contained (this is referring to your clothing with 2 things in the pockets)
  4. Skip the error - you can proceed with filling the tank
  5. Now, remove all but 1 item from your clothing pockets
  6. examine and try to fill again - no errors

Here, I have attempted to fill a beetle's gas tank while wearing jeans with 3 items in them. The error:

image

After skipping the error, I am prompted which inventory item to fill the tank with. The jerrycan is there, which is good - but I can also select the jeans:

image

If I choose to fill the tank from the jeans, one of the items disappears from the jeans (a cell phone), and I get a message that the tank has been refilled (though it hasn't):

image

I can do this with items from any of my pockets. If I have a backpack full of bricks, I can fill the gas tank with bricks from the backpack.

  • OS: Linux

    • OS Version: Distributor ID: Pop; Description: Pop!_OS 20.04 LTS; Release: 20.04; Codename: focal;

  • Game Version: 0.E-4941-gd04c8c6f19 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food]
    ]

Verified hat #42867 fixes the issue - when filling a vehicle tank, there are no error messages, and the prompt correctly includes only the liquids in my watertight containers:

image

Was this page helpful?
0 / 5 - 0 ratings