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

I put nodachi in my fish #71530

Closed
Syler1984 opened this issue Feb 5, 2024 · 16 comments · Fixed by #71557
Closed

I put nodachi in my fish #71530

Syler1984 opened this issue Feb 5, 2024 · 16 comments · Fixed by #71557
Labels
Items: Containers Things that hold other things (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Syler1984
Copy link

Describe the bug

If you have a fish corpse in your inventory, you can put different items in it by 'w'ielding and then un'w'ielding them. Works with fishing rods and nodachi and seemingly anything below certain volume. Disregards items length: I can put whole glaive in my fish and than that fish in makeshift sling. I tried to put 60 liter tank in my kokanee salmon and it didn't work.

Attach save file

Essex.zip

I am holding my American pickerel scabbard.

Steps to reproduce

  1. Put fish corpse in your inventory (pickerel, salmon and catfish works for sure). I used makeshift sling for this.
  2. Wield nodachi (make sure that you have no suitable containers for it except for your fish).
  3. Try to un'w'ield nodachi, select "Store in inventory".

Expected behavior

You can't put Mossberg 500 security shotgun in you yellow perch.

Screenshots

Screenshot_19

Screenshot_20

Screenshot_21

Versions and configuration

Version: 4aee1f3
OS: Windows 11

Additional context

No response

@Syler1984 Syler1984 added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Feb 5, 2024
@Fris0uman
Copy link
Contributor

Fris0uman commented Feb 5, 2024

Wasn't that fixed by #61575 ?

@Syler1984
Copy link
Author

Wasn't that fixed by #61575 ?

I am playing on relatively fresh build.

I tried to put 60 liter tank in my kokanee salmon and it didn't work.

Nevermind that.

cata_fish

Here are my twelve 100 L tanks in my salmon. When put in any other container, fish pocket settings can be changed in parent container pocket manager. So just put fish in 200 L barrel, set its priority to high value and then grab bunch of anything and it will fit. It seems like every fish has capacity of 1650 L.

@RedMisao
Copy link
Contributor

RedMisao commented Feb 5, 2024

Not sure if this is related. Yesterday I was trying something with corpse (item) and noticed they have an extremely large pocket size with the TARDIS flag. See corpses.json.

@Brambor
Copy link
Contributor

Brambor commented Feb 5, 2024

Not sure if this is related. Yesterday I was trying something with corpse (item) and noticed they have an extremely large pocket size with the TARDIS flag. See corpses.json.

Working link to corpses

@Brambor
Copy link
Contributor

Brambor commented Feb 5, 2024

Flag TARDIS definitely sounds like the cause.

- ```TARDIS``` Container item with this flag bypasses internal checks for pocket data, so inside it could be bigger than on the outside, and could hold items that otherwise won't fit its dimensions.

Maybe it is put on things that look like TARDIS, instead of things that should have infinite internal volume.

@Brambor
Copy link
Contributor

Brambor commented Feb 5, 2024

Other occurrences of TARDIS flag in the base game:

  {
    "id": "wallet_travel",
    "type": "TOOL_ARMOR",
    "category": "clothing",
    "symbol": ";",
    "color": "dark_gray",
    "name": { "str": "travel wallet" },
    "description": "A flat case with a neck strap, used to carry items such as currency, identification documents, laminated cards, and other small items.",
    "price": 15000,
    "price_postapoc": 250,
    "material": [ "plastic", "leather" ],
    "flags": [ "OVERSIZE", "BELTED", "ALLOWS_NATURAL_ATTACKS", "TARDIS", "COLLAPSE_CONTENTS", "POWERARMOR_COMPATIBLE" ],
    "weight": "708 g",
    "volume": "500 ml",
    "to_hit": -1,
    "material_thickness": 2,
    "pocket_data": [
      {
        "pocket_type": "CONTAINER",
        "rigid": true,
        "max_contains_weight": "600 g",
        "max_contains_volume": "500 ml",
        "moves": 400,
        "flag_restriction": [ "BANK_NOTE_SHAPED", "CREDIT_CARD_SHAPED" ]
      }
    ],
    "armor": [ { "encumbrance": 2, "coverage": 100, "covers": [ "torso" ], "specifically_covers": [ "torso_neck" ] } ],
    "melee_damage": { "bash": 1 }
  },

the following one probably cannot occur and is only for testing

  {
    "id": "debug_backpack",
    "type": "ARMOR",
    "name": { "str": "debug pocket universe" },
    "description": "A pocket universe.  Can store approximately 384 * 10^6 bugs.",
    "weight": "1 g",
    "volume": "1 L",
    "price": 0,
    "price_postapoc": 0,
    "material": [ "cotton" ],
    "symbol": "[",
    "looks_like": "backpack",
    "color": "yellow",
    "pocket_data": [
      {
        "rigid": true,
        "pocket_type": "CONTAINER",
        "max_contains_volume": "100000 L",
        "max_contains_weight": "100000 kg",
        "moves": 1,
        "max_item_length": "1 km",
        "weight_multiplier": 0.01,
        "volume_multiplier": 0.01
      }
    ],
    "warmth": 0,
    "material_thickness": 0,
    "flags": [ "BELTED", "WATER_FRIENDLY", "TARDIS", "OVERSIZE" ],
    "armor": [ { "encumbrance": [ 0, 0 ], "covers": [ "torso" ], "specifically_covers": [ "torso_hanging_back" ] } ]
  },

  {
    "type": "GENERIC",
    "id": "corpse",
    "symbol": "%",
    "color": "white",
    "name": { "str": "corpse" },
    "conditional_names": [
      { "type": "FLAG", "condition": "FIELD_DRESS", "name": { "str": "carcass", "str_pl": "carcasses" } },
      { "type": "FLAG", "condition": "FIELD_DRESS_FAILED", "name": { "str": "carcass", "str_pl": "carcasses" } },
      { "type": "FLAG", "condition": "SKINNED", "name": { "str_sp": "skinned %s" } },
      { "type": "FLAG", "condition": "QUARTERED", "name": "carcass quarter" }
    ],
    "description": "A dead body.",
    "//": "most of the properties depend on the monster type and are created at runtime!",
    "price": 0,
    "volume": "0 ml",
    "flags": [ "TRADER_AVOID", "CORPSE", "TARDIS" ],
    "category": "corpses",
    "pocket_data": [
      {
        "pocket_type": "CONTAINER",
        "moves": 100,
        "max_contains_volume": "1650 L",
        "max_contains_weight": "2000 kg",
        "max_item_volume": "150 L",
        "max_item_length": "60 meter",
        "rigid": false,
        "forbidden": true,
        "transparent": true
      }
    ]
  },
  {
    "type": "GENERIC",
    "id": "corpse_void_mummified",
    "symbol": "%",
    "color": "white",
    "name": { "str": "mummified corpse" },
    "description": "Waxen skin drapes the remnants of an unknowable death.",
    "looks_like": "corpse_generic_human",
    "category": "corpses",
    "material": [ "hflesh" ],
    "price": 0,
    "volume": "30 L",
    "weight": "32 kg",
    "flags": [ "TRADER_AVOID", "TARDIS" ],
    "pocket_data": [
      {
        "pocket_type": "CONTAINER",
        "moves": 100,
        "max_contains_volume": "1650 L",
        "max_contains_weight": "4000 kg",
        "max_item_volume": "500 L",
        "max_item_length": "60 meter",
        "rigid": false,
        "forbidden": true,
        "transparent": true
      }
    ]
  }

@Brambor
Copy link
Contributor

Brambor commented Feb 5, 2024

I think to fix this, just remove the TARDIS flag.

I guess I will make a PR, since I don't even need to compile to fix this :)

@MrHrulgin
Copy link
Contributor

To my understanding, corpses have the TARDIS tag so that, regardless of what loot spawns on them it all stays inside the corpse "container", rather than them bursting like a loot piñata upon death. I'd think of Chesterton's Fence and consider why the flag was applied in the first place.

@Brambor
Copy link
Contributor

Brambor commented Feb 5, 2024

I am changing the mentioned wallet to be rigid: false, like others, instead of TARDIS.

I will try to look what can corpses contain and set normal rigid: false pocket. But current behaviour is unacceptable.

I don't think that setting TARDIS flag on any pocket in base game is acceptable. I am changing the error suggesting doing that too.

@Cenness
Copy link

Cenness commented Feb 5, 2024

I think to fix this, just remove the TARDIS flag.

Removing flag would break ci checks and would not resolve the issue. Because the only purpose of it is to bypass this sanity check:

if( !type->has_flag( flag_TARDIS ) ) {
if( is_container( type ) ) {
units::volume volume = type->volume;
if( type->count_by_charges() ) {
volume /= type->charges_default();
}
if( item_contents( type->pockets ).bigger_on_the_inside( volume ) ) {
msg += "is bigger on the inside. consider using TARDIS flag.\n";
}
}
}

@Brambor
Copy link
Contributor

Brambor commented Feb 5, 2024

@Cenness
But when you set rigid: false, the containers volume increases with the content. Like canvas bag.

@Zireael07
Copy link
Contributor

IMHO we need a flag that works like TARDIS but only for spawned items (so that corpses work like before but you CAN'T put huge stuff in them)

@Brambor
Copy link
Contributor

Brambor commented Feb 5, 2024

IMHO we need a flag that works like TARDIS but only for spawned items (so that corpses work like before but you CAN'T put huge stuff in them)

I think this would necessitate a cpp change differentiating between player inserting things and the code inserting things.

I will try to see if my idea works. Didn't spawn corpses yet. If there is a particularly big corpse, refer me to it.

But my change would probably necessitate specifying container size for each corpse... I will see.

@RedMisao
Copy link
Contributor

RedMisao commented Feb 5, 2024

I don't think the flag is the problem, because it (corpses not having +1000 L of storage) was working before.
My guess is something broke between the generation of the corpse item and the steps the engine does to give it gives its in-game attributes. I mentioned the pocket and the flag in case someone with more experience in how those steps are done knows what stopped working.

@Brambor
Copy link
Contributor

Brambor commented Feb 5, 2024

TARDIS flag was added to corpses with "Zombies keep their loot with them when reviving" #50987

It specifically says:

disallowed bool: keep player or anything from putting more things in the pocket

So I guess that is the part that is broken.

It doesn't justify using the TARDIS flag, however.

@Brambor
Copy link
Contributor

Brambor commented Feb 5, 2024

I lost interest in this, at least for now. I was fiddling with the stylish wallet item. It is too late for me to think.

I did this:

diff --git a/data/json/items/generic.json b/data/json/items/generic.json
index 016a6587f1..d01c40e4c9 100644
--- a/data/json/items/generic.json
+++ b/data/json/items/generic.json
@@ -3883,7 +3883,7 @@
     "price": 15000,
     "price_postapoc": 250,
     "material": [ "plastic", "leather" ],
-    "flags": [ "OVERSIZE", "BELTED", "ALLOWS_NATURAL_ATTACKS", "TARDIS", "COLLAPSE_CONTENTS", "POWERARMOR_COMPATIBLE" ],
+    "flags": [ "OVERSIZE", "BELTED", "ALLOWS_NATURAL_ATTACKS", "COLLAPSE_CONTENTS", "POWERARMOR_COMPATIBLE" ],
     "weight": "708 g",
     "volume": "500 ml",
     "to_hit": -1,
@@ -3891,7 +3891,7 @@
     "pocket_data": [
       {
         "pocket_type": "CONTAINER",
-        "rigid": true,
+        "rigid": false,
         "max_contains_weight": "600 g",
         "max_contains_volume": "500 ml",
         "moves": 400,
diff --git a/src/item_factory.cpp b/src/item_factory.cpp
index 809457da0e..c5ecce2105 100644
--- a/src/item_factory.cpp
+++ b/src/item_factory.cpp
@@ -1925,7 +1925,7 @@ void Item_factory::check_definitions() const
                     volume /= type->charges_default();
                 }
                 if( item_contents( type->pockets ).bigger_on_the_inside( volume ) ) {
-                    msg += "is bigger on the inside.  consider using TARDIS flag.\n";
+                    msg += "is bigger on the inside.  Consider setting rigid to false or using TARDIS flag.\n";
                 }
             }
         }

@NetSysFire NetSysFire added (S2 - Confirmed) Bug that's been confirmed to exist Items: Containers Things that hold other things and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Items: Containers Things that hold other things (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants