* Convert integer parsing test to use normal TEST_CASEs
* Rename test name too similar to another
* Test to enforce normalized test names
* Normalize TEST_CASE names (scripted)
This work involved converting player_activity::placement to a
tripoint_abs_ms and then dealing with the fallout elsewhere.
For most activities, placement was already a global tripoint. In a few
cases it was a local tripoint, so conversions needed to be added at each
side.
In one case (ACT_START_ENGINE) it was a position relative to the avatar.
That's because the player might be starting the engine in a moving
vehicle, so using a fixed location isn't reliable. To support that use
case I added an additional relative_placement member to player_activity.
If and when ACT_START_ENGINE is migrated to activity_actor, that member
can be removed.
Also, added some documentation for the reality bubble coordinate system
and the conversion functions between global and local coordinates.
* Tear down entire threshold calcs + rebuild them
* Debug options for testing mutation categories
* New character menu properly removes mutations
* Adds mutations to Nerd- I mean Manatouched
Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>
Our string_id constants were a mixture of temporaries, locals, and
globals. Pull them all out as globals, for consistency and efficiency.
The efficiency comes from the fact that each string_id instance caches
its respective int_id, and sharing one instance means that value need
not be recomputed.
* Port code to emplace_back
This is clang-tidy making automated changes to convert push_back into
emplace_back whenever the argument to push_back is either a constructor
call for the type in question of an expression of a type implicitly
convertible to the type in question.
This should eliminate one move-construction of the inserted object for
each call.
* Enable clang-tidy modernize-use-emplace
Catch2 provides a customization point for converting our types to
strings by specializing the StringMaker template.
We have some specializations in stringmaker.h, but this feature was only
working intermittently. I finally figured out that was due to an ODR
violation. The test files that didn't include stringmaker.h were
compiling a different specialization than the ones that did.
Re-jig the test includes so that any file including catch.hpp also
includes stringmaker.h, thereby ensuring that the custom
specializations are used everywhere and there is no ODR violation.
I achieved this by adding a new cata_catch.h header and making all
existing headers include catch.hpp via the new header.
* Change _ctype.h and __locale to cctype and clocale
* Change _wctype.h to cwctype in game.cpp
* Change __functional_base to functional
* Remove libcxx internal headers
* Remove UNIX system headers
* Fix clang-tidy error with -nostdinc++
The mutation_category_trait objects have ids, but they were just
std::strings. Make them be a string_id<mutation_category_trait>
instead.
This is a general move towards type safety, although the specific goal I
wanted to achieve was better validity checking of cata_variants.
* Helper script to run IWYU
* Run IWYU
* Update deprecated headers
* Run IWYU again
* Re-suppress cxxabi.h
This pragma got accidentally removed because it was deemed to be a
comment attached to a #include.
* Remove extra SDL header includes
* Fix ime.cpp headers
Some tweaks to help IWYU not break this file by messing with
platform-specific stuff not relevant on Linux.
* Update game.h
* Move new point.h includes inside #ifdef
* Re-add platform_win.h to mapsharing.cpp
* Apply suggestions from code review
Co-authored-by: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com>
* Remove junk food morale effects from gum
Comestibles with the NO_INGEST flag are now exempt from ALLERGEN_JUNK
penalties or bonuses in `modify_morale`.
The in-game effect is that characters with "Junk Food intolerance" will
no longer get penalized (with a "Yuck!" message) when eating gum or
caffeinated gum. Similarly, characters with "Sweet tooth" or "Sugar
loving" will not get extra morale bonuses for "Mmm, junk food" when
eating NO_INGEST items like gum.
Tested with 3 test cases, and tested in-game with junk food intolerance
and sweet tooth.
* Force allergen/no_ingest and explain why
Return immediately from `Character::modify_morale` if the item has the
"NO_INGEST" flag. This prevents applying morale effects such as
ATE_WITH_TABLE when using non-food items such as bandages.
Includes two new regression tests that were failing before this fix was
made, and are now passing.
* Add first draft of modify_morale tests
* Add sweet tooth and saprophage test cases
* Tests for allergies and intolerances
* Simplify morale level checks
has_morale returns the modifier for that particualr morale type, so
using this for assertions should allow the contribution of `fun_for` to
be eliminated.
* Finish ursine honey test and tidy up
* Add tests for dining with table and chair
With and without strict table manners
* Hot food test, final cleanup