43 Commits

Author SHA1 Message Date
Eugene Lesnov cfd90552c2 Avoid preformatted possessive creature names 2026-10-16 21:18:49 +03:00
Matthew Richmond 9020833ece Stabilize test state resets and highway debug logging (#88577)
* Stabilize test state resets and highway debug logging

* tests: widen melee damage tolerance

* ci: retry overmap coverage

* ci: retry shader compile
2026-09-08 15:08:34 +02:00
Johnson 1f918518cd Merge pull request #88315 from Relvl/performance/few-performance-fixes-1
Performance/Improve few per-turn performance bottlenecks
2026-08-17 12:55:16 -05:00
Andrew Krieger 0215b26cce Rewrite all tests to clear map without touching character map memory, for performance. 2026-02-08 23:05:55 -08:00
salartarium 9962efbb59 Fix numerous basic typos in comments and documentation files (#83564)
* Update overmap_water.cpp

Fix typo

* Update horde_map_test.cpp

fix typo

* Update OPTIONS.md

fix typos and grammar

* Update overmap.h

fix typos

* Update condition.cpp

fix typo

* Update HELP_MENU.md

fix typo

* Update itype.cpp

fix typos

* Update sdlsound.cpp

fix typo

* Update construction.cpp

fix typo

* Update character_attire.cpp

fix typos

* Update battery_density_test.cpp

fix typos

* Update coverage_test.cpp

fix typo

* Update NPCs.md

fix typos

* Update MUTATIONS.md

fix typos

* Update subbodypart.h

fix typos

* Update contributing.md

fix typo

* Update itype.h

fix typo

* Update ranged_weapon_balance.md

fix typo

* Update achievements.json

fix typo

* Update advanced_inv.cpp

fix typo

* Update mapdata.h

fix typos

* Update item_degrade.cpp

fix typos

* Update ISSUE_TRIAGE.md

fix typo

* Update OVERMAP.md

fix typos

* Update MAPGEN.md

fix typo

* Update nest_conditional_placement_test.cpp

fix typos

* Update FREQUENTLY_MADE_SUGGESTIONS.md

fix typo

* Update REGION_SETTINGS.md

fix typo

* Update mutation.h

fix typos

* Update diary.h

fix typos

* Update doxygen_conf.txt

fix typo

* Update npc.h

fix typo

* Update lore.md

fix typo

* Update character.h

fix typos

* Update PowerDescriptionSpoilers.md

fix typo
2025-11-03 10:27:12 +01: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
moxian c44d65a8ae Run IWYU again to pick up the changes 2025-02-11 13:02:19 -08: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 99aeb7b990 Load npcs and deal with their bodies 2025-01-25 09:49:42 +01:00
osuphobia 818c74388a shot dispersion refactor 2025-01-17 23:33:31 +08:00
Procyonae 40f0b39e62 Merge branch 'master' into RemoveStringInitialisingItems 2025-01-10 17:00:48 +00:00
osuphobia 60c265e76d Refactor ammo_effect_BOUNCE (#79035)
* make projectile_attack void,
add targets_hit to dealt_projectile_attack, and
record hit data in it

* tweak BOUNCE

* Apply suggestions from code review

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

* clang

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-01-10 17:48:30 +01:00
Procyonae bd591a89b6 Typify standard_npc constructor raw clothing strings 2025-01-10 16:43:09 +00:00
Procyonae 982df19d0f Change /tests remaining uses of raw string item initialisation to use itype_id s
"remaining uses" being somewhat of an understatement -_-
2025-01-10 15:31:15 +00:00
osuphobia e94fcc1bbd test case adjustment 2025-01-01 01:16:44 +08:00
PatrikLundell 26eb173d36 typified character.h + npc.h (#78623)
* typified character.h + npc.h

* demanded collateral change

* demanded collateral change
2024-12-18 20:03:41 -06:00
PatrikLundell c380147ab2 typified creature.h and monster.h (#78565)
* typified creature.h and monster.h

* Update src/monmove.cpp

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

* Update src/monster.h

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

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-16 22:16:00 -06:00
boyboytemp dee71b3a71 fix displaying of stats for ablative armor
Currently protection/coverage stats are not displayed in 'sort armor
screen' and 'body status screen'.

The issue was reported originally in #62126
2024-12-16 04:17:33 +03:00
mqrause 4c69e47b2a change target_handler::trajectory to std::vector<tripoint_bub_ms> and then fix errors until it compiles again (#76671)
Co-authored-by: mqrause <martin@qrause.de>
2024-09-27 12:10:50 -07:00
Fris0uman 0c7dd6a4c3 Use ammo_effect_str_id instead of std::string (#73931)
* 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>
2024-06-14 22:44:11 -04:00
mqrause bd211963e6 move item_pocket::pocket_type to it's own header 2023-11-27 13:22:35 +01:00
randomtyper 9e021bfcac New transparent plastics, material adjustments (#67147)
* New transparent plastics, material adjustments.

* Update iteminfo test in accordance with changes

* Update coverage test in accordance with new changes

* Fix stuff

* Fix
2023-08-06 10:58:27 -05:00
anoobindisguise 7dba942d24 Nerf lycra (#66737)
* nerf protection of lycra

* zentai has less prot now

* nerf zentai

* Update coverage_test.cpp
2023-07-07 23:44:41 -05:00
Alexey 07356b65a5 Normalize TEST_CASE names (#66241)
* 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)
2023-06-17 13:57:19 -03:00
Dillon Matchett 7c48da007d Rigid Plate Pockets (#65863)
* Rigid Plate Pockets

* Fixes + Ablative Always

* Fixes For Tests

* Test Corrections

* Update coverage_test.cpp

* Make const

* test fix
2023-06-15 10:45:11 -05:00
David Seguin 6141f7651e damage_type: jsonify damage types
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.
2023-04-24 01:38:15 -04:00
Alexey Kim 5c0f2a791f Remove item::min_damage, item::damage_floor, itype::damage_min 2023-03-28 03:06:50 +03:00
John Bytheway 875cadf142 Enable performance-unnecessary-value-param (#59533)
This clang-tidy check looks for potentially-expensive-to-copy value
parameters which are only used as const values.

If they are only used once, in an assignment or initialization, then
their use will be converted to std::move.  This can save a copy in some
cases.

Otherwise, the parameter will be converted to a const reference, which
can also save a copy in some cases.
2022-07-23 19:29:45 -04:00
bombasticSlacks 2edbc8e9b7 ablative armor can now cover more locations than the base 2022-06-10 12:03:28 -03:00
bombasticSlacks 586e726b0f first test can make cleaner 2022-06-10 11:48:50 -03:00
Dillon Matchett 728eb5217e Increased the manhacks accuracy (#55516) 2022-02-20 09:00:14 -08:00
Dillon Matchett 90b1c80986 More robust test for multi material portions (#55461)
* super robust test

* fix divide by 0

* tougher armor to increase values
2022-02-19 13:34:45 -08:00
bombasticSlacks 50be3c202b more clarity in comments 2022-02-15 14:49:47 -04:00
bombasticSlacks 17d9491623 added a unit test 2022-02-15 14:29:50 -04:00
Dillon Matchett f70cf38bb3 Made Flakey Coverage Test Wider (#55286) 2022-02-12 10:00:13 +03:00
Binrui Dong 37f33b0ca4 Allocate test NPC on heap (#54965) 2022-02-05 23:45:03 -08:00
Binrui Dong edc305582e Shift creature positions in coverage test (#55037) 2022-02-03 09:29:41 -08:00
David Seguin 3b4583bb09 Fix ranged coverage tests (#54851)
* Clear map before starting projectile tests

For whatever reason, there is a chance that a tile between the
shooter and the shootee is impassable (obstacle). This means that
in map::shoot(), the projectile damage is set to zero as it crosses
that point (see `src/map.cpp:3874`).

* Adjust CHECK to use Approx

Co-authored-by: Eric Pierce <wapcaplet88@gmail.com>
2022-01-27 21:03:48 -08:00
Dillon Matchett 473d0954a7 Direct attacks now check each material individually (#53958) 2022-01-09 18:40:29 -08:00
Dillon Matchett 13a65f3517 Fix body part not being used to generate resistance objects (#54079)
* pass body part all the way down the line

* updated the failing test
2022-01-06 10:08:59 +03: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
David Seguin 0bea3fdd5a Proportional Material - Armour Edition (v2) (#52540)
* Refactor materials/portions/thickness applied to resistances

Co-authored-by: Binrui Dong <brett.browning.dong@gmail.com>
2021-11-13 19:07:10 -08:00
David Seguin 7483c5db6c Add coverage tests 2021-10-27 23:59:40 -04:00