Commit Graph

362 Commits

Author SHA1 Message Date
moxian c44d65a8ae Run IWYU again to pick up the changes 2025-02-11 13:02:19 -08:00
moxian a66f0d6cd8 mechanically run IWYU on "simple" files (--safe_headers)
... three times, until it stops making new suggestions.
Run with --safe_headers (default) (i.e. headers can only
get new includes added, but can't get anything removed)
The code does not compile in current state (kinda expected),
manual fixups will follow.
--nosafe_headers commit would also follow afterwards

The "simple" files are those that don't have any sort of
define/if defined/ifndef conditional compilation in them.
Just plain old c++ with no preprocessor.

Code size:
includes:
$ cat obj/tiles/*.inc | wc
 290436  580872 17972230
$ cat tests/obj/tiles/*.inc | wc
 168196  336392 10510740
post-processed (clang -E):
cat ./out/pp/src/* | wc
69365093 179919823 2157445134
cat ./out/pp/tests/* | wc
40499273 106027071 1277878587

The code size increase is expected due to --safe_headers
2025-02-10 00:46:59 -08:00
PatrikLundell af4d7228ad typified stuff 2024-12-24 12:32:43 +01:00
Brambor 602647da03 iwyu: run for src/ folder, A*-F* files
skipped some files since they were complicated
2024-04-15 23:32:46 +02:00
Maleclypse 6fd7a44c72 Mutation list computer function (#72132)
* Mutation list computer function

Ports https://github.com/Cataclysm-TISH-team/Cataclysm-TISH/pull/93

Update computer_session.h

Co-Authored-By: Anton Burmistrov <11132525+night-pryanik@users.noreply.github.com>

* Update src/computer_session.cpp

Co-authored-by: Jianxiang Wang (王健翔) <qrox@sina.com>

---------

Co-authored-by: Anton Burmistrov <11132525+night-pryanik@users.noreply.github.com>
Co-authored-by: Jianxiang Wang (王健翔) <qrox@sina.com>
2024-03-06 17:18:59 -05:00
andrei 59541474be eoc/talker: distinguish between undefined and empy vars
stop equivalating undefined variables with empty variables
2024-01-16 18:29:19 +02:00
Binrui Dong aabd6d3160 Clean up duplicate header includes [readability-duplicate-include] 2023-03-31 00:41:19 +08:00
casswedson e699348b1d chore: typo hunting ft. codespell (#56320)
* chore: typo hunting ft. codespell

I discovered codespell yesterday while looking at the vim repo
I like it, I use it here

* re-re-re-review all changes

Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
2022-03-27 11:50:37 -07:00
Eric 924f221179 Create talker_furniture, move refugee center computer into dialog system. (#52717) 2021-11-13 20:03:55 -08:00
Kevin Granade 5e7b1b305c Merge pull request #51133 from Night-Pryanik/return-of-the-nuke
Return of the nuke (in No Hope mod)
2021-10-16 00:07:49 -07:00
Maleclypse f4994d343e [Aftershock] Arcology First Floor (#49951)
* Extend/Delete in requirements

* Revert "Extend/Delete in requirements"

This reverts commit 9da0eaeb4e.

* Valentine Cards (#47438)

* Add a proficiency for handloading, and a new profession (#47244)

* Drug Dealer Profession (#47255)

* Adds hallula, a type of bread popular in Bolivia and Chile

* Arm mounted pouch (#46946)

* Tazer drone iii (#47353)

* Added Gelatin and Several Gelatin Based Recipes (#47080)

* Content: bread in a can (#45680)

* New random mission (#44999)

* Mycus fruit Juice (#44952)

* Milleable corn (#46254)

* Talk Tag Additions (#47010)

* Fix typo in Valentines Card (#47583)

* (CrazyCataclysm) Crazy Hallucinations (#47386)

* Mealgurb (#47685)

* Add duct tape blindfold for old reciepe plus tweaks for reciepe (#47527)

* Prepare npc, spell, character, and item for new ai (#47207)

* Make acetylene torch cut metal walls. (#46255)

* Added disassembly recipes for several items (#46316)

* Celsius temperature for freezing point (#47028)

* Stand up peek (#47257)

* [AFTERSHOCK] Basic Ballistic Weapons (#47559)

* makes glass walls and glass doors constructable (#47692)

* Crackers as bread and jam&cheese sandwich (#47649)

* [Aftershock] misc typograpical fixes (#47783)

* Tweaks for teas (#47848)

* Have travis run for 0.F-dev

Currently, .travis.yml has a 'development' branch specified as one to run tests for; the current equivalent is the 0.F-dev branch.

* Tweakes to copper and metal pipes. (#47825)

* Fried eggs deluxe, sandwiches, and condiment list (#47786)

* Homemade toastems, buttercream frosting and recipes (#47696)

* Chocolate Cow don't drop "cow pies"

* Remove unused FATIGUE energy source from spells

* [Magiclysm] add owlbear origin snippet (#47752)

* [Magiclysm] add lesser banishment spell, buff greater banishment (#47537)

* Unhardcode bio_heatsink and bio_climate

* Hunting lodge Location (#44378)

* fungal evolution (#47247)

* Add book strap carrier (#47665)

* Partial mine jsonify; new zombie miner (#47790)

* Moved mine_entrance OMT from the list of hardcoded locations to industial locations

Also removed mine_shaft OMT and replaced it with mine_shaft_middle and mine_shaft_lower OMTs.
Also added mine_entrance_roof OMT.

* Added mine_entrance and mine_shaft to the list of obsoleted terrains

* Added a zombie miner and its death drops

* Created a json-version of mine entrance and its roof

* Created a json-version of mine shaft (middle and lower variants)

* Changed overmap special definition of a mine to include new json chunks

* Applied migration of hardcoded mine_entrance and mine_shaft OMTs to new json variants

* Made hardcoded mine chunks generate to the west of lower section of new mine shaft OMT

Also removed mine_entrance and mine_shaft from the list of hardocoded mapgen.

* Completely removed build_mine_room function as all mine rooms are now defined in json

Also removed hardcoded generation of mine entrance and mine shaft.

* Removed mentions of mine rooms from mapgen.h

* Updated alt_map_key mod

* Updated graphical overmap mod

* Added missing harvest

* Appease clang and constify

* Quickfix

* Appease clang one more time

* Add 0.F-dev to matrix.yml

(Getting 0.F-dev working with Travis appears to require additional settings by someone with permissions.) This change enables both pushes and pull requests of 0.F-dev to get checked by the General Matrix. As it is, if one bases a PR off of 0.F-dev, it doesn't get checked by Github.

* 0.F-dev workflows (#47875)

* Alter brown bread recipe to match canned version

Fixes #47874.

* Mine entrance expand (#47928)

* Added mine_materials item group

* Added Trolley vehicle

* Expanded and tweaked above-ground and underground levels of mine entrance

* [DinoMod] Mushroom Madness (#47907)

* misc typograpical fixes

* body pillow recipe makes makeshift body pillow now (#47917)

* Traffic Bollards and an example of deployment (#48017)

* add description for Uyen's missions

* JSONize some trap features, replace trap int_id externs with string_ids (#47933)

* JSONize trap sonar detectibility

Add trap flags - just the same as normal flags, but for traps! Stick
them in their own separate file to avoid confusion.

* JSONize trap memorial messages

light_snare and heavy_snare seem to no longer exist, or I couldn't find
any reference to them but this and tilesets.

Updated dissector trap message, and added a trap message to some traps
(the hallway ones, one or two of the similar-but-not-the-same variants
of existing traps).

* JSONize trap temperature convection

Not quite sure how to describe it, went the lazy route.

* Move traps externs from int to string ids

When loading the game without this content, these will now only give an
error on the use of these, instead of at the end data loading for traps.

Previously there were performance concerns with this, but this should be
fine since #44261 - see #44500.

tr_null must remain an int id, as it used in the string to int id
conversion. This is fine, as it will always be loaded (it's in
data/core).

Move the ledge trap over to data/core as well, because everything will
need the 'open space' trap.

* Clean up character mutation gain a bit

Reduce duplicated code.
I presume there's a reason that set_mutations didn't just call
set_mutation, and the only difference is that it doesn't do the cache
updates till the end, so preserve that behaviour.

* Allow CBMs to specify mutations that prevent installation. (#47822)

* Move CBM installation checks to Character

Reduce code duplication, encapsulate things better, and make this
available outside of the inventory menus.

* Allow mutations to prevent installing CBMs

Bionics can currently cancel mutations when installed, but can't have
mutations prevent installation.

* Spiral mine jsonify (#48003)

* prevent bell spam (#47987)

* Note that vat is required for fermentation in vinegar brewing

* Unhardcode ease of sleep

* calorie test

* Revert "calorie test"

This reverts commit e5355755a9.

* Arcology Start

Adding windows and entrances

organization

more mapgen

organization and more overmaps

Update arcology_ground.json

Update arcology_ground.json

Last of the gates

Update arcology_gate_chunks.json

city special and terrain

chunks

Update arcology_ground.json

Update arcology_chunks.json

Update data/mods/Aftershock/itemgroups/arcology_groups.json

Update recipe_obsolete.json

chunkening

testing

fixes

Update arcology_ground.json

Update arcology_ground.json

fixes

neverending fixes

the lintening

Update arcology_gate_chunks.json

Update arcology_gate_chunks.json

Update arcology_gate_chunks.json

Can force spawn now but it is blank

Update arcology_chunks.json

15 tons and whadya get

reverses north and south

Ready for testing

Gates open

Open and Close gates using console

broken metal flooring

* Open and Close

* Lint

* Apply suggestions from code review

Co-authored-by: John Candlebury <johncandlebury@gmail.com>

Co-authored-by: LaVeyanFiend <51099123+LaVeyanFiend@users.noreply.github.com>
Co-authored-by: slimeboy460 <68845349+slimeboy460@users.noreply.github.com>
Co-authored-by: ToxiClay <ToxiClay@users.noreply.github.com>
Co-authored-by: Jamuro-g <76928284+Jamuro-g@users.noreply.github.com>
Co-authored-by: Xenomorph-III <sam1998may@gmail.com>
Co-authored-by: grawprog <77870049+grawprog@users.noreply.github.com>
Co-authored-by: Xaleth <countolaf17@gmail.com>
Co-authored-by: El-Jekozo <72350516+El-Jekozo@users.noreply.github.com>
Co-authored-by: RobertoVGoulart <robertovgoulart@yahoo.com.br>
Co-authored-by: Zukulini <dragon.fuego.yo@gmail.com>
Co-authored-by: klorpa <30924131+klorpa@users.noreply.github.com>
Co-authored-by: UmbralReaper <67179462+UmbralReaper@users.noreply.github.com>
Co-authored-by: SariusSkelrets <68650913+SariusSkelrets@users.noreply.github.com>
Co-authored-by: Fosheze <50811445+Fosheze@users.noreply.github.com>
Co-authored-by: Lamandus <33199510+Lamandus@users.noreply.github.com>
Co-authored-by: Curtis Merrill <curtis.r.merrill@gmail.com>
Co-authored-by: NeviNovat <51816321+NeviNovat@users.noreply.github.com>
Co-authored-by: Karol1223 <68503002+Karol1223@users.noreply.github.com>
Co-authored-by: Hirmuolio <22011552+Hirmuolio@users.noreply.github.com>
Co-authored-by: Charlie Gardai <32105250+Moltenhead@users.noreply.github.com>
Co-authored-by: Mom-Bun <43492737+Mom-Bun@users.noreply.github.com>
Co-authored-by: OromisElf <oromis.der.lehrer.eragons@freenet.de>
Co-authored-by: casswedson <58050969+casswedson@users.noreply.github.com>
Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com>
Co-authored-by: Fris0uman <sthapplz@gmail.com>
Co-authored-by: Ramza13 <52087122+Ramza13@users.noreply.github.com>
Co-authored-by: LyleSY <lyle.sollayates@Gmail.com>
Co-authored-by: FuelType-Memes <42695732+FuelType-Memes@users.noreply.github.com>
Co-authored-by: Anton Burmistrov <Night_Pryanik@mail.ru>
Co-authored-by: actual-nh <actual-nh@users.noreply.github.com>
Co-authored-by: casswedson <nelson1003403634@gmail.com>
Co-authored-by: akirashirosawa <38557723+akirashirosawa@users.noreply.github.com>
Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: John Candlebury <johncandlebury@gmail.com>
2021-09-11 22:34:54 -07:00
John Bytheway 9eb8e7682f Add cata_fatal macro (#51507)
Extend the cata-assert check to suggest using cata_fatal, a new macro
for fatal errors.

Use that new macro to replace uses of abort, assert( false ), etc.
2021-09-10 22:32:34 -07:00
akrieger 006c10b379 Convert a bunch of trivial deserialize functions off JsonIn
Most instances of deserialize instantly convert from JsonIn to the
object oriented interface, usually JsonObject. Using the improved
interface on JsonIn we can change the signatures on these to more
accurately reflect what they're doing. Also help get rid of JsonIn
which is not supported in the binary json refactor this unblocks.
2021-09-07 18:08:48 -07:00
Valiant e1b19740c3 Re-added ability to launch nuclear missile 2021-08-27 22:54:24 +04:00
John Bytheway 159413daa2 Enable clang-tidy bugprone-branch-clone (#49629)
* Enable bugprone-branch-clone

This check looks for multiple branches of an else-if-chain or switch
that are the same.  This is often a sign of a copy/paste error.

The cases that hit in these changes did not include any copy/paste
errors, as far as I could see, but they did highlight quite a few cases
where the code could be usefully refactored.  I did that, and in other
cases I just suppressed the error.

Did fix one small bug related to furniture moving weariness, but that
was just because I happened to be pointed at nearby code, not because it
specifically related to the check.

* Move utf32_to_utf8 to json.cpp

When I deduplicated this function I previously kept the version in
catacharset.cpp, but that breaks the link for the json formatter, so
instead keep the version in json.cpp.

Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com>
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
2021-07-12 10:17:17 -07: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
John Bytheway e189957ff2 Run IWYU 20200408 (#39364)
* 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>
2020-04-10 12:16:19 +03:00
Jianxiang Wang (王健翔) ab6c686264 Update string extraction script and fix computer translation (#39405)
* Extract martial art initiate message and other updates to the extraction script

* Fix translation of computer strings
2020-04-09 17:44:16 +03:00
Jianxiang Wang (王健翔) e792bb88f0 Computer refactor part 2 (#37299)
* Remove unnecessary/unused members of class computer

* Make name and mission_id of computer private

* Make alerts a member of computer

* Move initialization of next_attempt to constructor

* Replace shutdown_terminal with reset_terminal

* Check option enum instead of (translated) option string

* Migrate computer_action and computer_failure_type to use enum conversion

* Use JSON (de)serialization in class computer

* Lift ordering restriction of computer_action and computer_failure_type

* Remove COMPACT_OBSOLETE

* Fix COMPFAIL_DESTROY_DATA range

* Remove const modifiers in function declarations

Co-Authored-By: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com>

Co-authored-by: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com>
2020-01-24 09:38:58 +03:00
Qrox 4384d966ce Move computer window to a separate class 2020-01-20 20:59:13 +08:00
Fris0uman 75681c32e5 radiation is private 2019-12-30 19:29:35 +01:00
ZhilkinSerg cfa0c4c8bb Merge pull request #36462 from ymber/turret_despawn
Remove all CROWS type turrets with computer action
2019-12-26 22:56:36 +03:00
ymber ed22f644d3 Remove all CROWS type turrets with computer action 2019-12-26 10:15:40 +00:00
Anton Burmistrov d18fc5dbe9 Reworked computer menu UI (#36427)
* Reworked computer menu to use uilist

* Added fourth security reminder for HWS computer
2019-12-26 10:25:08 +03:00
Kevin Granade 1f3199e47b Remove nuke launch and do some cleanup. (#35242)
* Move internal computer methods out of header file

* Remove instances of miss_launch

* Skip loading of blacklisted computer options

* Deprecate nuke launch enum

* Kill nuke launch code.
2019-12-24 22:26:09 +03:00
Valiant f6e0d84c8d Revert limiting search radius ro 3 tiles 2019-12-18 11:03:21 +04:00
Kevin Granade 84c1e9ed81 Merge pull request #36016 from KorGgenT/scope-game-inv
rescope game::inv_for_ functions
2019-12-17 05:22:39 +00:00
Anton Burmistrov 28ab7207f5 Fixed list of bionics showing item durability indicator (#36123)
* Fixed list of bionics showing item durability indicator

* 3 tiles max
2019-12-15 23:04:52 +03:00
KorGgenT f72eae332a refactor game::inv_for_filter
- rescope to game_menus::inv::
- rename function to titled_filter_menu
- remove superfluous functions in favor of generic filter function
- fix function calls
- return item_location instead of int pos
- add avatar parameter
2019-12-12 20:34:59 -05:00
ZhilkinSerg fc141c8ade Made global variables static (species_id) 2019-12-11 01:09:35 +03:00
ZhilkinSerg d8ad327430 Made global variables static (effect_id) 2019-12-11 01:09:35 +03:00
ZhilkinSerg 3b04d65e8b Made global variables static (skill_id) 2019-12-11 01:09:35 +03:00
ZhilkinSerg 9cdc949408 Made global variables static (mtype_id) 2019-12-11 00:05:49 +03:00
BevapDin 604b633621 Change functions that accept a JsonObject to take that as reference to const. (#35936)
* Make most functions of JsonObject coost.

* Change functions that accept a JsonObject to take that as reference to const.

Those functions do not change the object, they just read values from it. This avoid unnecessary copy-operations and allows usage of temporary objects (which don't bind to non-const references).

* Remove unnecessary calls to JsonObject::allow_omitted_members

* Fix build for cata_tiles.cpp

* Fix JSON object member being unvisited

* Fix potential nullpointer access in JSON classes:

Error reporting functions are public and can be called on any object, even on those that do not have an associated stream.
2019-12-09 22:32:52 +03:00
ZhilkinSerg 151b3aec42 Reformatted comments
- moved comments to separate lines;
- removed redundant comments.
2019-11-28 17:17:40 +03:00
ZhilkinSerg 40b5aa2b2a Use tripoint instead of point parameters 2019-11-27 23:56:27 +03:00
Qrox 01893bd8b4 Use string ids instead of hashes for snippets 2019-11-09 14:45:52 +08:00
Jianxiang Wang (王健翔) 8f0f6bba5a Replace three ascii dots with the unicode ellipsis (#34777) 2019-10-18 01:11:32 +03:00
Jianxiang Wang (王健翔) 2ef63e59cc Unify text spacing after punctuations (#34617)
* Unify text spacing after punctuations
* Fix translator comment position
* Remove spaces after ellipses that start a sentence
* Remove spaces before punctuations and end of lines
2019-10-13 11:33:05 -07:00
ZhilkinSerg b0c967a1c8 Apply suggestions from code review 2019-10-07 13:12:17 +03:00
ZhilkinSerg bca3935c65 Use function for tripoint to point conversion 2019-10-07 09:42:11 +03:00
BevapDin 9af8684109 Use new place_critter functions where suitable:
"where suitable" means:
- spawning monsters within an area (not a single specific point),
- points within the area are equally likely,
- requirements are only `g->is_empty`.

Note that this sometimes moves the statement for spawning the critter around. This is to avoid having side effects (like printing a message, deducting moves) if spawning fails.
2019-09-28 22:46:42 +02:00
BevapDin 73084c37c2 Add and use a function map::points_on_zlevel
It returns all points on a given (or default) z-level.
2019-09-23 05:59:23 +02:00
BevapDin 942ea2725e Call map::points_in_radius instead of manually iterating over x and y. 2019-09-23 05:59:22 +02:00
BevapDin 5a30e5d5f0 Fix accessing items on blue floor via computer:
Instead of iteration over the points of the top most, left most submap ((0,0) to (SEEX-1, SEEY-1)) - iterate over the points around the player (which should be lactated right next to the computer).
2019-09-23 05:59:22 +02:00
Raf Geens 07c1f6397a Add an extra warning when secubots can spawn on failing a computer hack (#34111)
* Ignore .vimrc file

* Added optional JSON hacking warning to computer

* Combined standard access denied message with optional warning

* Updated all json mapgen computer definitions that spawn secubots

The access denied message is more verbose so the player is aware
something really bad will happen if they fail the hack attempt.

* Updated hardcoded mapgen computer definitions that spawn secubots

The access denied message is more verbose so the player is aware
something really bad will happen if they fail the hack attempt.

* Backwards compatibility when loading old saves

* Style fixes

* Use double spaces between sentences in access denied message

* Made access_denied a translation instead of a string

* Added access_denied field to extract_json_strings

* Save access_denied raw string instead of the translated one

The translation now happens when it gets actually printed.

* Revert "Save access_denied raw string instead of the translated one"

This reverts commit b8d1f58f6d.

It's a bad idea to save raw strings, because translation will
break if they change.
2019-09-21 00:25:26 +03:00
ZhilkinSerg 0dea7c3ffa Merge pull request #33971 from Night-Pryanik/missile_silo_jsonify
Missile silo jsonify
2019-09-12 13:44:17 +03:00
Valiant d8f585ada0 Increased explosion power tenfold previous explosion doesn't even kill the zombie 2019-09-12 10:02:32 +04:00
Valiant 8089a3f0ac Astyle 2019-09-12 09:14:11 +04:00
Valiant a92db18d70 Updated explosion and smoke gas according to the new mapgen 2019-09-11 22:17:27 +04:00