-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Tests: clear_map() clears basecamps #78016
Tests: clear_map() clears basecamps #78016
Conversation
I think you should put clearing camps into |
Wow, I never thought about that. Agree with mqrause that camps should be cleared with clear_map(). |
That's a good idea. It looks like removing the camps in just this test created another error, so I might as well give it a shot. May submit to a new PR if it ends up working. |
1d11155
to
9efa05c
Compare
9efa05c
to
d7d01d1
Compare
Not trying to bikeshed, but you might want to also erase it from the camps list stored on the player character Cataclysm-DDA/src/faction_camp.cpp Lines 2184 to 2185 in 47cf7fd
overmapbuffer::remove_camp does not do this, normally it's handled inside basecamp::abandon_camp() |
fix test npc_talk_location
d7d01d1
to
7b59707
Compare
Summary
Bugfixes "clear basecamps for tests in clear_map()"
Purpose of change
When the test
npc_talk_location
was run after any set of tests that makes a basecamp (e.g.camp_calorie_counting
), it would fail. This was because camps could still exist on the overmap tile from those previous tests, which would count as a dialogue response for this:and the dialogue counts would be larger than expected.
Describe the solution
EDIT: clear_map() removes all basecamps, added it to the test. Added a
REQUIRE
that makes sure there aren't any camps found.Describe alternatives you've considered
Testing
Ran
npc_talk_location
by itself and withcamp_calorie_counting
before it, no errors.EDIT: Ran all tests locally, no issues, check for test errors in CI
Additional context
The faction camp OM used (
faction_base_camp_11
) is legacy, should probably be removed