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

Seatbelts do not drop seat belt item when uninstalled, but range of synthetic fabric #4012

Closed
Relgar opened this issue Dec 29, 2023 · 8 comments · Fixed by #4367
Closed

Seatbelts do not drop seat belt item when uninstalled, but range of synthetic fabric #4012

Relgar opened this issue Dec 29, 2023 · 8 comments · Fixed by #4367
Labels
Milestone

Comments

@Relgar
Copy link
Contributor

Relgar commented Dec 29, 2023

Describe the bug

Some recipes call for seatbelt items - however, these have stopped being uninstalled as seatbelt 'items'. If you disassemble a seat belt from a vehicle it will turn straight into it's disassembly components. Compare this with mufflers which disassemble correctly and drop a muffler.

Steps To Reproduce

  1. Spawn a vehicle
  2. Remove seatbelts
  3. Notice you get 0-3 synfab instead of a seatbelt item

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.3803 (22H2)
  • Game Version: 36a2fd9 [64-bit]
  • Graphics Version: Tiles
  • LAPI Version: 1
  • Game Language: []
  • Mods loaded: [
    Bright Nights [bn],
    Disable NPC Needs [no_npc_food],
    Simplified Nutrition [novitamins],
    No Rail Stations [No_Rail_Stations],
    Prevent Zombie Revivication [no_reviving_zombies],
    Limit Fungal Growth [limit_fungal_growth],
    Aftershock [aftershock],
    Mythical Martial Arts [MMA],
    No Filthy Clothing [no_filthy_clothing],
    No Lifting Reqs [disable_lifting],
    SpeedyDex [speedydex],
    Stats Through Kills [stats_through_kills],
    Stats Through Skills [StatsThroughSkills]
    ]

Additional context

May be related to #3489 as JSON code has not changed in months.

@Relgar Relgar added the bug label Dec 29, 2023
@RoyalFox2140
Copy link
Collaborator

I am convinced it is related to #3489 because I found a version before 0.5 stable where I get seatbelts. Game report is below.

image

  • OS: Windows
    • OS Version: 10.0.19045.3448 (22H2)
  • Game Version: 7e70561 [64-bit]
  • Graphics Version: Tiles
  • LAPI Version: 1
  • Game Language: English [en_US]
  • Mods loaded: [
    Bright Nights [bn],
    Elevated bridges [elevated_bridges],
    Craftable Gun Pack [craftgp],
    Alternative Map Key [alt_map_key],
    Fuji's Military Profession Pack [fuji_mpp],
    Arcana and Magic Items [Arcana],
    Craftable Bullet Casings [CasingCrafting],
    MST Extra [MST_Extra],
    Tankmod: Revived [Tankmod_Revived],
    Essence 2200 BN [Essence2200_BN],
    Essence 2200 Tweaks [FoxTweaks],
    Nonperishable Overhaul [Nonperishable_Overhaul],
    No Addictions [No_Addictions],
    Limit Fungal Growth [limit_fungal_growth],
    Disable NPC Needs [no_npc_food]
    ]

@RoyalFox2140
Copy link
Collaborator

Tested on 0.5 Stable. You remove the broken I I seatbelt, I gained no items on removing the seatbelt.

image

  • OS: Windows
    • OS Version: 10.0.19045.3448 (22H2)
  • Game Version: 0.5 [64-bit]
  • Graphics Version: Tiles
  • LAPI Version: 1
  • Game Language: English [en_US]
  • Mods loaded: [
    Bright Nights [bn],
    Craftable Gun Pack [craftgp],
    Alternative Map Key [alt_map_key],
    Craftable Bullet Casings [CasingCrafting],
    MST Extra [MST_Extra],
    Essence 2200 BN [Essence2200_BN],
    Essence 2200 Tweaks [FoxTweaks],
    Nonperishable Overhaul [Nonperishable_Overhaul],
    No Addictions [No_Addictions],
    Limit Fungal Growth [limit_fungal_growth],
    Disable NPC Needs [no_npc_food],
    Simplified Nutrition [novitamins],
    Mining Mod [Mining_Mod],
    Rural-Only Mapgen [ruralbiome],
    No Monsters [Only_Wildlife]
    ]

@Relgar
Copy link
Contributor Author

Relgar commented Dec 29, 2023

Almantuxas outlined the mechanism of the bug on the Discord here.

@scarf005
Copy link
Member

to re-iterate from discord:

if( broken ) {
p.add_msg_if_player( _( "You remove the broken %1$s from the %2$s." ),
veh->part( vehicle_part ).name(), veh->name );
} else {
p.add_msg_if_player( _( "You remove the %1$s from the %2$s." ),
veh->part( vehicle_part ).name(), veh->name );
}
if( !broken ) {
resulting_items.push_back( veh->part( vehicle_part ).properties_to_item() );
for( const auto &sk : vpinfo.install_skills ) {
// removal is half as educational as installation
p.practice( sk.first, veh_utils::calc_xp_gain( vpinfo, sk.first, p ) / 2 );
}
} else {
auto pieces = veh->part( vehicle_part ).pieces_for_broken_part();
resulting_items.insert( resulting_items.end(), std::make_move_iterator( pieces.begin() ),
std::make_move_iterator( pieces.end() ) );
}
if( veh->part_count() < 2 ) {
p.add_msg_if_player( _( "You completely dismantle the %s." ), veh->name );
p.activity->set_to_null();
here.destroy_vehicle( veh );
here.reset_vehicle_cache( );

int itype::damage_max() const
{
return count_by_charges() ? 0 : damage_max_;
}

for some reason damage_max for count-by-charge items is always 0.

@scarf005 scarf005 added this to the Stable v0.5.2 milestone Dec 31, 2023
@Relgar
Copy link
Contributor Author

Relgar commented Dec 31, 2023

This may be because damage is no longer tracked per item. Which becomes awkward if you're tracking say damage to 50 bullets. The problem also becomes that you can't just make something damage a stack like XX Rope (6) either.

@scarf005
Copy link
Member

scarf005 commented Jan 1, 2024

i guess we'd need to implement proper damage sharing logic for stackables. this gonna be big...

@Relgar
Copy link
Contributor Author

Relgar commented Jan 3, 2024

Depends - how does damage currently track for 'normal' stackables like coins or ammo? Can it get destroyed?

@scarf005 scarf005 modified the milestones: Stable v0.5.2, Stable v0.5.3 Jan 6, 2024
@seerdecker
Copy link

Also impacted by this bug in 0.5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants