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

Fix house id matching in hardcoded missions #37473

Merged
merged 1 commit into from
Jan 28, 2020

Conversation

ralreegorganon
Copy link
Contributor

@ralreegorganon ralreegorganon commented Jan 28, 2020

Summary

SUMMARY: Bugfixes "Fix house id matching in hardcoded missions"

Purpose of change

After we removed the procedurally generated houses which were tied to the house overmap terrain, we've subsequently created a large set of distinct houses and the house overmap terrain only exists now for any mods that haven't yet migrated to specific city_building entries for them.

However, we have several hardcoded missions which target houses in the city (e.g. dog, zombie mom, software), and all of those were targeting the house overmap terrain. This means that they'd probably end up targeting an empty field (which is how house currently renders if there are no mods providing a terrain), or falling back to the city center (aka the crossroads in the center of the city).

We also have one of the scavenging missions for the tacoma ranch that also attempts to loot houses.

Describe the solution

This changes the code that finds the house to instead do a "prefix" match on house, which means it will find all of the house variants that follow the pattern.

Describe alternatives you've considered

Longer term, I think we want to get away from matching on the name that must follow a convention and instead match on flags or things like the land use codes, but for the purposes of having this work properly for 0.E, I think this is sufficient.

Testing

Spawned in the evac center, edited the NPC to have the missions in question, started them, and verified that they targeted houses in the nearby city that were actual houses and not just the empty field house version.

Ran through the tacoma ranch missions up to the point where the scavenger boss is available, debugged him to have the "level 1" missions trait, spawned an NPC, made him my companion, sent him on a scavenging raid, waited for it to complete, try a couple times because he died on the raid, and then on a successful one confirmed via the debugger that the scavenging raid return targeted a valid house for looting. (also, this scavenging raid is broken-ish and tries to set the targeted terrain to looted_building but that's actually invalid because the terrain is rotatable and so it needs to be a rotated id, but that's a whole other issue).

@ralreegorganon ralreegorganon added Missions Quests and missions [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) labels Jan 28, 2020
@ZhilkinSerg ZhilkinSerg merged commit fb0e570 into CleverRaven:master Jan 28, 2020
@ralreegorganon ralreegorganon deleted the fix-house-matching branch April 7, 2020 16:09
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` Missions Quests and missions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants