* refactor death message, corpse spawn and death drops suppresion vars
* Apply suggestions from code review
Co-authored-by: np4Huk <22.valiant@gmail.com>
* Fix test issues
---------
Co-authored-by: np4Huk <22.valiant@gmail.com>
- matrix.yml SKIP condition referenced non-existent job names
(skip-duplicates, skip-duplicates-mods); corrected to match declared
jobs (skip-duplicates-code, skip-duplicates-data). Same fix for the
commented emscripten block.
- tests/Makefile batch runs now use --user-dir with a unique PID-based
path so parallel shard execution doesn't collide on filesystem state.
- Normalized comma-separated TEST_CASE tags to space-separated across
9 test files (25 declarations). Comma syntax is deprecated in Catch2
v2 and removed in v3. Also fixed a missing space between adjacent
tags in throwing_test.cpp.
* typified a bit of map.h/cpp + dependents
* demanded changes
* demanded master changes drawn to its conclusion
* second int should be in corresponding location
* Use ammo_effect_str_id instead of std::string
* replace RECOVER_ flag with a new field
* Update json
* Update doc
* remove unused ammo_effect
* update mods
* fix ids for clang
---------
Co-authored-by: Fris0uman <fris0uman@users.noreply.github.com>
My debug code in #71585 introduced a divide by zero, resulting in infinite fragmentation density.
It seems the msvc std::poisson_distribution constructor doesn't like infinite values.
It turns out that a lot of loading code depends on
the availability of certain damage types.
I see two ways to resolve this:
1) Juggle the loading order of JSON types so that damage
types always load first.
2) Add deferred processing for every type with inline
damage type definitions.
I went with option 2, which is better but still
not great since new code that loads damage/resistance
definitions would need to also call finalize_damage_map
in the finalizing stage. Option 1 would cause problems
for mods, especially because the load order would matter.
None of this can be done piecemeal, it has to all be ripped
out in one go unless we want commits that don't compile
on their own.
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.
* partial vehicle damage reduction hotfix
trying to make vehicles less immortal. also removed ridiculous recipe for "hard plating"
* rescale rams to 1.25* durability/dr of their respective plates
* add a small amount of dr to some otherwise fragile components
* linting
* fix explosion damage test to look at total vehicle hp
also added additional test cases
* car stereos shouldn't do the star trek console explosion thing either
* 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++
* Add units::angle and port various code to use it
Add a typesafe angle type. Partly for general type safety but also to
avoid confusion between different measures of angle (radians, degrees,
and arcmin are all used in this codebase.
Convert tileray to use the new type, and deal with the fallout from
other things that depend on tileray.
Most of the changes relate to changing vehicle facing to the new type.
Note that this changes vehicle facing from an integer to a floating
point type, which could cause some behavioural change.
* Include math_defines.h for Window build
Previously we had separate functions closest_points_first and
closest_tripoints_first. We'd like to extend this functionality to
coord_point, but it's easier to do if both the raw underlying functions
have the same name (so the generic wrapper can be the same).
To that end, rename closest_tripoints_first to closest_points_first
(they are chosen between based on overload resolution), and add a
wrapper to allow coord_point to be used similarly.
There was an overload for operator== between string_id and const char*,
allowing direct comparison with literals. This goes against most of the
other properties of string_id in that you must usually be explicit about
conversions between it and strings.
Also, it hampers refactoring, because you might not notice that a
comparison has become incorrect when changing the type of a variable.
Remove that operator overload and update code using it accordingly.
* 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>
* Ignore damage to battery_car in explosion_balance
After seeing a test failure for this test, and looking into it, I think
the damage is simply because the explosion got an unusually high amount
of damage by chance. So I've added battery_car to the whitelist of
things we'll ignore if they're damaged.
* Fix test ordering dependency
npc_talk_conditionals relied on a previous test setting player cash.
Have it do so locally.
* Refactored `closest_(tri)points_first` functions
- moved into `point` file;
- rearranged function parameters;
- removed duplicate code;
- get rid of some `auto` and one time use variables;