Skip to content

Commit

Permalink
Very misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade committed Apr 4, 2022
1 parent 35fcc10 commit 85d0fbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6769,7 +6769,7 @@ std::unique_ptr<vehicle> map::add_vehicle_to_map(
}
veh_to_add->refresh( true );
// this could probably be done in a single loop with installing parts above
std::vector<int> parts_in_square = veh_to_add->parts_at_relative( source_point, true );
std::vector<int> parts_in_square = veh_to_add->parts_at_relative( source_point, false );
std::set<int> parts_to_check;
for( int index = parts_in_square.size() - 1; index >= 0; index-- ) {
if( handler_ptr ) {
Expand Down
13 changes: 4 additions & 9 deletions src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3334,9 +3334,8 @@ float vehicle::fuel_specific_energy( const itype_id &ftype ) const
for( const vpart_reference &vpr : get_all_parts() ) {
if( vpr.part().is_tank() && vpr.part().ammo_current() == ftype &&
vpr.part().base.only_item().made_of( phase_id::LIQUID ) ) {
float mass = to_gram( vpr.part().base.only_item().weight() );
total_energy += vpr.part().base.only_item().specific_energy * mass;
total_mass += mass;
total_energy += vpr.part().base.only_item().get_item_thermal_energy();
total_mass += to_gram( vpr.part().base.only_item().weight() );
}
}
return total_energy / total_mass;
Expand Down Expand Up @@ -5900,11 +5899,6 @@ void vehicle::refresh( const bool remove_fakes )
std::set<int> smzs = precalc_mounts( 0, pivot_rotation[0], pivot_anchor[0] );
// update the fakes, and then repopulate the cache
update_active_fakes();
map &here = get_map();
here.add_vehicle_to_cache( this );
for( const int dirty_z : smzs ) {
here.on_vehicle_moved( dirty_z );
}
check_environmental_effects = true;
insides_dirty = true;
zones_dirty = true;
Expand Down Expand Up @@ -7415,7 +7409,8 @@ int vehicle::get_non_fake_part( const int part_num )
return part_num;
}
}
debugmsg( "Returning -1 for get_non_fake_part on part_num %d on %s.", part_num, disp_name() );
debugmsg( "Returning -1 for get_non_fake_part on part_num %d on %s, which has %d parts.", part_num,
disp_name(), parts.size() );
return -1;
}

Expand Down

0 comments on commit 85d0fbe

Please sign in to comment.