68 Commits

Author SHA1 Message Date
RenechCDDA da2aaffffd Add quick setup option to clear map 2026-06-22 15:07:51 -04:00
RenechCDDA cb924413e4 Move init_veh_status to an enum (oh god) 2026-05-17 23:11:41 -04:00
PatrikLundell 586cf5f1ce Mapify: character etc. sees + sundry others (#79699)
* Mapify: character etc. sees + sundry others

* demanded changes

* Corrected correction
2025-02-18 09:29:22 -06:00
PatrikLundell f9900fccc2 Merge pull request #79670 from PatrikLundell/mapify
mapify: split ammo remaining into link and non link
2025-02-16 14:49:56 -06:00
PatrikLundell 7bfa56fa99 Merge branch 'master' into mapify 2025-02-13 08:46:56 +01:00
moxian c44d65a8ae Run IWYU again to pick up the changes 2025-02-11 13:02:19 -08:00
moxian 73ec6e4584 Merge branch 'master' into iwyu-l-27 2025-02-11 10:40:53 -08:00
PatrikLundell 0ac675121c mapified a little item prompting a lot of vehicle 2025-02-11 15:10:00 +01:00
PatrikLundell 470e1312ee mapified a lot of vehicle stuff (#79611)
* mapified a lot of vehicle stuff

* fixed complaint, but properly
2025-02-10 17:25:39 -06:00
moxian 2ee44002fd Mechanically IWYU the tests
python3 ~/github/include-what-you-use/iwyu_tool.py -j5 -p build $( find
src/ tests/ -maxdepth 1 -name '*.cpp' | grep -v -f
tools/iwyu/bad_files.txt )  --  -Xiwyu --comment_style=long -Xiwyu -
-max_line_length=1000 -Xiwyu --cxx17ns -Xiwyu
--mapping_file=../tools/iwyu/cata.imp   | tee out/iwyu/f-a-01.txt >
/dev/null

followed by

cat out/iwyu/f-a-02.txt | python3
~/github/include-what-you-use/fix_includes.py --reorder --nosafe_headers

followed by manual fixups of <stddef.h> -> <cstddef> and similar.

tests/generic_factory_test.cpp gets mangled very badly (IWYU bug) so
it's excluded from the list.

Code size:
includes:
$ cat obj/tiles/*.inc | wc
 288068  576136 17898260
$ cat tests/obj/tiles/*.inc | wc
 167044  334088 10465766

post-processed source (clang -E):
./make_preproc.sh src/
68567896 177775140 2134075721
./make_preproc.sh tests/
39341957 102891720 1243323710
2025-02-10 00:46:57 -08:00
PatrikLundell 4fb5f14234 make some vehicle operations map aware (#79599)
* make some vehicle operations map aware

* hid names of unused parameters

* Update src/vehicle.h

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* equality, not assignment

* demanded change

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-08 22:06:31 -06:00
PatrikLundell 6a0cc1e154 made more vehicle stuff map aware (#79544)
* made more vehicle stuff map aware

* demanded change

* demanded change
2025-02-06 00:57:40 -06:00
PatrikLundell 278c26a11d Convert some vehicle operations to be map aware (#79477)
* Convert some vehicle operations to be map aware

* Oops, forgot to carry the parameter through

* removed unused operation
2025-02-03 07:54:29 +01:00
PatrikLundell e64cd5b8a1 Start to make vehicle coordinates make sense 2025-01-31 17:16:47 +01:00
Anton Simakov f0f37055e8 obsolete units::legacy_volume_factor (#78972)
* obsolete units::legacy_volume_factor

* Update src/vehicle_use.cpp

Co-authored-by: Brambor <tondadrd@seznam.cz>

---------

Co-authored-by: Brambor <tondadrd@seznam.cz>
2025-01-09 10:14:03 -06:00
PatrikLundell befd4486d1 sundry typification (#78985)
* sundry typification

* demanded work around
2025-01-06 22:26:26 -06:00
Clarence "Sparr" Risher 8b27b967ae Replace point constants with static class members 2024-11-26 10:14:26 -05:00
PatrikLundell afb794bbc5 typified a bit of vehicle.h and dependents 2024-11-03 15:08:15 +01:00
PatrikLundell 1e456eb6d7 typified a bit of vehicle.h + dependents 2024-10-13 14:46:58 +02:00
PatrikLundell 456a199f5c typified a bit of map.cpp and dependents 2024-10-08 16:23:15 +02:00
PatrikLundell c5c01140ba typified a bit of map.h/cpp + dependents (#76712)
* typified a bit of map.h/cpp + dependents

* demanded changes

* demanded master changes drawn to its conclusion

* second int should be in corresponding location
2024-10-02 23:34:12 -05:00
Alexey 6320df8d45 Trim int overloads from vehicle::get_items 2023-07-12 20:22:09 +03:00
John Bytheway ba794fe260 Enable clang-tidy check cert-err33-c
This check looks for unused return values on a variety of C library
functions.

I resolved most of the warnings by printing out some kind of error
message in the event that the function failed.

Many of them are low-level things whose failure indicates some sort of
serious problem, so the errors are simply printed to stderr, because our
usual error reporting infrastructure might not be available.
2023-05-24 07:13:18 -04:00
mqrause 720d4b5840 unhardcode vehicle efficiency test data (#63088)
Co-authored-by: mqrause <martin@qrause.de>
2023-01-13 19:54:14 -05:00
Alexey e1fa86fbc9 Obsolete lit_aisle (#61028)
* Obsolete lit_aisle

* Adjust ambulance test to new mass
2022-09-17 00:36:52 -03:00
Hirmuolio 6adf2881a0 Handle fuel energy and vehicle energy_consumption as units::energy (#60607)
* energy_consumption as energy

* units::energy fuel

* units::energy material

* item fuel adjustments

* bionuc reload window

* bionic reload window

* typo

* bionic power from pedaling

* adjust electric vehicle tests

* mods

* mods

* rename some variables

* cleanup

* temp fix bionic

* temp fix treshold

* fuel tests

* adjust mod

* adjust mod

* adjust mod

* rename variable

* migration

* migration

* consumption_per_hour

* fuel does not need to count by charge

* actually is sort of has to
2022-09-08 13:53:47 +02:00
Brennan Tekulve 90393d171d Fix Engine Sizes and Weights (#58768) 2022-07-16 19:29:21 +03:00
Brennan Tekulve cb051eb5ba Density - various object Pt 1 (#57158)
* Density - various object Pt 1

Jewelry, fuel, electric motors, vehicle batteries, bedding, mutagen, tool_armors, clown nose

* Revert battery changes

Revert battery changes for another pull request

* Jewelry, fuel, and test fixes

Added material portions to jewelry, corrected jewelry and fuel to match materials.json, fixed tests

* Implemented suggestions

Reverted enhanced motor weight and added copper material, re-added lead to car battery materials, fixed tests
2022-06-26 22:04:46 -03:00
Brennan 956d91decc Vehicle battery overhaul (#57193)
* Change vehicle batteries

Slight change to lead-acid batteries, buff storage batteries, rename storage and large storage battery, tweak crafting and disassembly of storage batteries, fix radio tower battery requirement
2022-05-04 10:43:08 -07:00
wwkk222208 1b35543aa9 Fix perpetual motion (#53670)
* Fix perpetual motion

* modify test file
2021-12-22 22:46:42 -08:00
John Bytheway e95a4fc9b8 Promote string_id constants to global statics
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.
2021-11-19 19:10:09 -05:00
John Bytheway ebd549b300 Fix StringMaker ODR violations in tests
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.
2021-07-03 07:42:06 -07:00
ANickelN 560d4d4709 Fix glass weights, lengths and volumes (#48449) 2021-07-03 07:42:05 -07:00
Meelock f1fd8b6a2d Add disassembly recipe for cargo space, cargo aisle (#47643)
* Add cargo asile to disassembly recipes 
* Make cargo aisle weight consistant
* Change to be reversible recipes
* Update cargo space weight, hopefully fixes the check
Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
2021-02-22 10:45:11 -08:00
Binrui Dong 9fdb7ef59c Run IWYU
* 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++
2021-02-06 00:18:41 -05:00
akirashirosawa 56d6b99c2b Fix range-loop-analysis (clang 12) (#45657) 2020-11-27 14:54:13 +03:00
John Bytheway b285a13080 Make time_point( int ) constructor explicit
Resolves a TODO on that constructor, and one more TODO elsewhere due to
the resulting refactoring.

time_point was implicitly convertible from int.  This led to unclear
code.  In particular, the item constructor took a time_point and a
quantity, and these two ints appeared adjacent with no obvious way to
see what they meant at call sites.

Make the constructor explicit, so the conversion is no longer implicit.
Update the rest of the code accordingly.

In most cases switched from 0 to calendar::turn_zero, which is
equivalent.  In a couple of places, used start_of_cataclysm instead,
when it seemed more appropriate (such as birthday of toilet water).
It's possible there are more cases which should have been something
other than turn_zero.
2020-11-10 11:21:02 -08:00
John Bytheway 2c04d796ef Add units::angle and port various code to use it (#44805)
* 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
2020-10-18 21:24:56 +00:00
Alexey Kim 23d3fb4cf7 Refresh motorcycle headlights (#44016) 2020-09-08 03:16:13 +00:00
John Bytheway ebfe558c2a Make more things static
Factor out some variables into a new very-low-weight
cached_options.{h,cpp}.  This helps for users of e.g. test_mode.
2020-09-05 23:13:04 -04:00
John Bytheway bf910e50e3 Declare lots of things static
Use the new clang-tidy check to convert a bunch of declarations to
static.

In a few cases, there were 'secret' dependencies being exposed without
headers.  Convert those to work via headers instead.
2020-09-05 23:13:04 -04:00
I-am-Erk 3cca52dab0 The Great Vehicle Parts Adjustment (#43012) 2020-08-20 00:24:59 +03:00
Broken27 8cfe0e71f8 Changed vehicle beds to require a mattress (#42429) 2020-08-17 19:31:15 +03:00
Kevin Granade c5ccf0c2c7 IWYU for tests (#42806) 2020-08-09 09:46:57 +03:00
Kevin Granade 05e958de3f Merge pull request #42626 from mlangsdorf/vehicles_reverse_fix
vehicles: make sure going in reverse isn't more efficient than going forward
2020-08-02 07:21:52 +00:00
Fris0uman 10e6058207 Remove body_part from effect (#42277)
* Effects use bodypart_id
* remove default value and unecessary overrides
* effect_map use bodypart_str_id, and replace num_bp with bp_null
2020-08-01 22:45:04 +00:00
Mark Langsdorf 49e3c97e51 vehicle efficient: add reverse tests
Add test cases for vehicles in reverse, and make sure that vehicles
moving in reverse are not dramatically more efficient than the same
vehicle moving forward.

As part of that, reduce the target speed from 70 mph to 50 mph.
2020-08-01 10:37:45 -05:00
Mark Langsdorf 42713a304e vehicles: do not become crazily efficient in reverse
Rework the engine load calculation so that vehicles moving in
reverse apply load based on the effective slowdown, and do not
suddenly become impossibly efficient.
2020-08-01 09:34:37 -05:00
Kevin Granade 6d1841ac67 Precompiled Catch2 header (#42453)
* Hoist catch.hpp include to the top of files

* Precompile the catch header in tests
2020-07-29 01:28:26 +03:00
Zukulini b00f30328a density fixes (#42434) 2020-07-27 02:06:29 +03:00