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

Fixes overmap vehicle tracking/remembering with bike rack #37467

Merged

Conversation

SeventhSandwich
Copy link
Contributor

@SeventhSandwich SeventhSandwich commented Jan 28, 2020

SUMMARY: Bugfixes "Fixes overmap vehicle tracking/remembering with bike rack"

Purpose of change

Closes #37311
When the player chooses to 'Remember Vehicle Position', the overmap tracking is lost when the vehicle is loaded and unloaded on a bike rack. This leads to annoying situations where a tracked shopping cart gets lost after unloading, without the player ever having chosen to forget it.

Describe the solution

This PR incorporates a new vehicle part integer flag called 'tracked_flag' that is assigned when a vehicle with tracking turned on is carried on a bike rack. When the bike rack is unloaded, the vehicle is added back to the overmap for tracking.

The way it works is that a tracked-vehicle loaded on a bike rack stops being tracked until it's unloaded, and then tracking is automatically enabled.

Describe alternatives you've considered

I considered adding functionality to track an individual vehicle part on the overmap - to allow racked vehicles to be tracked on the map while being carried. That seemed extraneous for just one bugfix.

Testing

I built CDDA in Visual Studio 2019 and tested various combinations of racking one or multiple vehicles with/without tracking them. My changes seem to work as expected.

Note that unloading a tracked vehicle sends the same message to the player as turning on tracking normally. "You start keeping track of this vehicle's position". I don't consider this a problem.

Additional context

None

fixed bikerack wiping overmap tracking for carried vehicles
@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Map / Mapgen Overmap, Mapgen, Map extras, Map display Vehicles Vehicles, parts, mechanics & interactions labels Jan 30, 2020
@ZhilkinSerg ZhilkinSerg merged commit fb6e745 into CleverRaven:master Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Map / Mapgen Overmap, Mapgen, Map extras, Map display Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

You lose "Remember Vehicle Position" On vehicle when placed on a Bike Rack
2 participants