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

basecamps: add an emergency recall option #34560

Merged

Conversation

mlangsdorf
Copy link
Contributor

Summary

SUMMARY: Features "basecamps: add an emergency recall option"

Purpose of change

Fixes #31872

Some basecamps are getting stuck in extremely weird states, where an NPC is shown as having completed a mission but can't be selected for recall.

Add the option to recall any NPC that has been on a mission for more than 24 hours. This cancels the mission without refunding any resources, but can be used to recover NPCs that are otherwise
stuck.

Describe the solution

Add a new parameter to mission_companion_choose_return() called by_mission that defaults to true. If by_mission is false, the mission_id check to determine whether a companion is valid to return is skipped.

Added an emergency recall mission that works with all camp workers, has a variable deadline of more than 24 hours, and uses a special return function that directly calls mission_companion_choose_return() with by_mission = false.

Alternate Solutions

I need to look at the timed events code so that NPCs return automatically when their missions are complete.

Additional context

Tested by retrieving the 3 companions who could not be recalled normally from the save game in #31872. Also sent out a companion and verified that the emergency recall option didn't happen until 24 hours had passed.

@mlangsdorf mlangsdorf added <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` Player Faction Base / Camp All about the player faction base/camp/site labels Oct 8, 2019
src/faction_camp.cpp Outdated Show resolved Hide resolved
Fixes CleverRaven#31872

Add the option to recall any NPC that has been on a mission for
more than 24 hours.  This cancels the mission without refunding
any resources, but can be used to recover NPCs that are otherwise
stuck.
@kevingranade kevingranade merged commit 9b5fba1 into CleverRaven:master Oct 9, 2019
@mlangsdorf mlangsdorf deleted the basecamp_emergency_recall branch October 10, 2019 11:11
@mlangsdorf
Copy link
Contributor Author

Stupid dyslexia - this fixes #31782.

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` <Enhancement / Feature> New features, or enhancements on existing Player Faction Base / Camp All about the player faction base/camp/site
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPC ordered to construct blueprint can eventually switch to his/her long term goal and run away.
3 participants