- made tripoint_range end on its first point when min is above max
- made tripoint_range::size() return 0 for inverted bounds
- added inverted bounds tests to map_iterator_test
- added off-map center tests for map::points_in_radius
* 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>
* typified a bit of map.h/cpp + dependents
* demanded changes
* demanded master changes drawn to its conclusion
* second int should be in corresponding location
* typified a bit of map.h/cpp + some dependents
* Macro crasher found by one compiler!
* demanded changes
* stupid wokaround for demanded changes
* Sort out conflict mess
* Restore map's abs_sub after map_coordinate_conversion_functions
./tests/cata_test "map_coordinate_conversion_functions","Mattack dialog condition test"
* Rewind time in biometrics tests
./tests/cata_test "basal metabolic rate with various size and metabolism","mutations may affect character metabolic rate"
* Don't place avatar on invalid zlevels
./tests/cata_test "npc_compare_int","npc_can_target_player"
./tests/cata_test "npc_arithmetic","npc_can_target_player"
* Martial art test should clear map
./tests/cata_test "walls should connect to walls as end pieces","Martial art technique conditionals"
* Clear map in turrets test
./tests/cata_test "vehicle_ramp_test_61","vehicle_turret"
* Clear map in gun repair test
./tests/cata_test "cube_direction_add_om_direction","Gun repair with degradation"
* Fix bionic test order dependency
./tests/cata_test "fueled bionics"
* Build light cache in player_activities_test
./tests/cata_test "grenade_lethality_scaling_with_size","activity interruption by distractions"
* Clear map in pockets test
./tests/cata_test "character should lose moves when opening or closing doors or windows","multipocket liquid transfer test"
* Make explicit flag for crafting cache invalidation
* Clear more avatar fields
* Clear time in weary_recovery
./tests/cata_test craft_available_via_vehicle_rig,vision_see_wall_in_moonlight,vision_moncam_basic,weary_recovery
* Fix map coordinate conversion functions
The new map coordinate conversion functions added in #59187 were almost
all wrong. They forgot that map::abs_sub has a z-coordinate, which was
getting mistakenly added to or subtracted from the coordinates involved.
This in particular broke all construction when not on zlevel 0.
Add a bunch of tests to verify that these coordinate conversion
functions behave properly, and fix them.
Continuing the effort to move the game towards type-safe points. The
last commit added coordinate systems relative to the reality bubble.
This origin gets the abbreviation bub, and four aliases point_bub_ms,
point_bub_sm, tripoint_bub_ms, and tripoint_bub_sm represent these
points.
As a starting point, I have converted all or most of the
construction-related code to these new point types. This started in
construction.cpp and I followed the compiler errors and continues to
port code so long as it seemed construction related.
One big change is that lots of the map functions are getting extra
overloads taking these new point types. During the period where we are
still porting code these overloads will exist in parallel with those
taking raw points. However, the long term plan is to remove the old
overloads, and I've marked each with a TODO comment to that effect.
I didn't discover any bugs in the process of these changes and there
should not be any behavioural changes.
The mapgen coverage test was loading various OMTs via calling load on
tinymap. This can break vehicle caching if the tinymap overlaps the
main map.
Add a sanity check in map::load to detect this issue.
Tweak the mapgen coverage test to avoid such OMTs.
Update some other tests to also avoid this issue.
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.