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

Pause game when x-com arrives for investigation #448

Merged
merged 15 commits into from
Jan 2, 2019

Conversation

FranciscoDA
Copy link
Contributor

Merges #408 and adds support for multiple vehicles and agents on foot.
Should also work if:

  • The vehicle/agent was destroyed while traveling
  • The vehicle/agent changed mission while traveling

@FranciscoDA
Copy link
Contributor Author

Relevant note:
The clang4 build was failing because the algorithm for generating the starting base tries random layouts by adding and removing facilities. Removing living quarters while there are agents in the building should fail, therefore causing an error in the base generation.
It's possible for a starting base to have agents inside it if they are spawned as hireable agents (this happens during GameState::fillOrgStartingProperty). Moreover, there's nothing preventing a hireable agent to spawn inside an XCom base!
This edge case is dependent on the seed used in the rng. Here's one that causes such behaviour:

  • Seed: 1545206368882

I've worked around this issue by generating the starting base (by calling GameState::fillPlayerStartingProperty) before the hireable agents are created.
A more complete fix should prevent agents to spawn from XCom bases or purchaseable buildings.

Copy link
Collaborator

@JonnyH JonnyH left a comment

Choose a reason for hiding this comment

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

Just change the 'investigate' name and I'm happy merging :)

game/state/city/building.h Outdated Show resolved Hide resolved
@FranciscoDA
Copy link
Contributor Author

Building::investigate was renamed to Building::pendingInvestigatorCount in a505ea0
Eventually we should add a serializable state object to represent an ongoing investigation to allow multiple investigations in the same building and maybe vehicles

@FilmBoy84 FilmBoy84 merged commit cdf65dc into OpenApoc:master Jan 2, 2019
@FranciscoDA FranciscoDA deleted the Jarskih-commenceInvestigation branch January 19, 2019 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants