Skip to content

Commit

Permalink
vehicles: rationalize damage on removal (CleverRaven#35444)
Browse files Browse the repository at this point in the history
Fixes CleverRaven#23215

When removing vehicle parts, rationalize the damage to the damage
level * damage_scaling so that the removed parts will stack
nicely with each other.
  • Loading branch information
mlangsdorf authored and AMurkin committed Nov 13, 2019
1 parent 9f10c1c commit 74eea12
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vehicle_part.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ item vehicle_part::properties_to_item() const
tmp.active = true;
}

// force rationalization of damage values to the middle value of each damage level so
// that parts will stack nicely
tmp.set_damage( tmp.damage_level( 4 ) * itype::damage_scale );
return tmp;
}

Expand Down

0 comments on commit 74eea12

Please sign in to comment.