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

Mitigate overhead of walking all loaded submaps for vehicle processing. #36913

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,9 @@ bool game::do_turn()
// Process power and fuel consumption for all vehicles, including off-map ones.
// m.vehmove used to do this, but now it only give them moves instead.
for( auto &elem : MAPBUFFER ) {
if( sm->vehicles.empty() ) {
Copy link
Contributor

@ZhilkinSerg ZhilkinSerg Jan 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sm is only initialized several lines below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as well I have a better fix ready.

continue;
}
tripoint sm_loc = elem.first;
point sm_topleft = sm_to_ms_copy( sm_loc.xy() );
point in_reality = m.getlocal( sm_topleft );
Expand Down