Skip to content

Commit

Permalink
Fix vehicle parts being unrepairable after removing from vehicle (#79391
Browse files Browse the repository at this point in the history
)

* fix vehicles parts repairability

* try fix clang tidy error

* accept gh bot suggestion

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Kilvoctu and github-actions[bot] authored Jan 29, 2025
1 parent 3f77ca4 commit 203edf8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8542,7 +8542,8 @@ item vehicle::part_to_item( const vehicle_part &vp ) const

// quantize damage and degradation to the middle of each damage_level so that items will stack nicely
tmp.set_damage( ( tmp.damage_level() - 0.5 ) * itype::damage_scale );
tmp.set_degradation( ( tmp.damage_level() - 0.5 ) * itype::damage_scale );
tmp.set_degradation( ( static_cast<double>( tmp.degradation() ) / itype::damage_scale - 0.5 ) *
itype::damage_scale );
return tmp;
}

Expand Down

0 comments on commit 203edf8

Please sign in to comment.