Skip to content

Commit

Permalink
Merge pull request #74616 from anothersimulacrum/0.H-backport-73596
Browse files Browse the repository at this point in the history
0.H fake parts fixes
  • Loading branch information
dseguin authored Jun 17, 2024
2 parents 9c36b4d + 6429c7d commit 8c4e268
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6284,7 +6284,7 @@ void vehicle::refresh( const bool remove_fakes )
}

const auto need_fake_part = [&]( const point & real_mount, const std::string & flag ) {
int real = part_with_feature( real_mount, flag, true );
int real = part_with_feature( real_mount, flag, false );
if( real >= 0 && real < part_count() ) {
return real;
}
Expand Down Expand Up @@ -7402,6 +7402,10 @@ int vehicle::damage_direct( map &here, vehicle_part &vp, int dmg, const damage_t
invalidate_mass();
coeff_air_changed = true;

// update the fake part
if( vp.has_fake ) {
parts[vp.fake_part_at].base = vp.base;
}
// refresh cache in case the broken part has changed the status
// do not remove fakes parts in case external vehicle part references get invalidated
refresh( false );
Expand Down

0 comments on commit 8c4e268

Please sign in to comment.