Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Merging manual conflicts again #3

Merged
merged 101 commits into from
Feb 5, 2022

Conversation

a-chancey
Copy link
Owner

Summary

Category "Brief description"

Purpose of change

Describe the solution

Describe alternatives you've considered

Testing

Additional context

matshou and others added 30 commits January 29, 2022 11:10
Player should be able to mix whitelist and blacklist rules without having to choose only one mode of filtering.
Automatic Rifleman class for CRT mod was missing pants
Drew4484 and others added 25 commits February 4, 2022 13:53
* Updates Spawns

* Place as loot

* Update mil_base_z0.json
* Update ballistic_armor.json

* was double dipping
Co-authored-by: Maleclypse <[email protected]>
Co-authored-by: Binrui Dong <[email protected]>
* Add stone sickle and GRASS_CUT quality

* Reduce cutting damage and needed hammering quality
* fuels_left() works with item

* use get_item_thermal_energy()

* use current phase

* ammo_required() is more generic

* combine different tanks for turrets

* split fuel_items_left() from fuels_left()

* correct unit in comment

* specify unit here too
Co-authored-by: Maleclypse <[email protected]>
* Fix nested pockets pickup

There are quite some discrepancies between can_contain and
best_pocket functionality. This commit looks to fix that and actually
allow nested pockets to work properly as long as there is space.
fixes #54725
* Alternate implementation of my earlier town hall varient

LovamKiscsiGazsii Suggested an alternate way to add the same content I tried to add originally to another PR that wouldn't require changing any files other than the town hall file.

Co-authored-by: Bence <[email protected]>
Co-authored-by: Dillon Matchett <[email protected]>
…\armor\storage (#55073)

* Molle Attachment Recipe addition and Consistency Check

As per my plan in #54549 , this is a completion of the first three stages.  The added molle attachments are now craftable.

Guidelines were 3h/leather piece, 1.5h/patchwork cotton, 1.5h/lyrcra, as per the weight-time guidelines in /data/json/requirements/tailoring.json . Each molle specific item gained 1/2/3 small straps and clasps, depending on PALS_ SMALL/MEDIUM/LARGE flags, with corresponding .5h to stitch each.
Non MOLLE items that can be worn as MOLLE, like the wrist bandoleer, did not get these straps, but were generally moved one size higher in PALS_ size.

All items that were to be strapped to the body acquired a strap if they did not have one already, a large one if the volume to be stored was in excess of ~2 L.  Each strap now has a clasp to use it with.

All pouches now have 1-to-1 fasteners, especially those that before, only had clasp yet protected their contents from water, or those that used larger or fewer numbers of fasteners depending on XL/XS.

As going through this, several items were found to not have the proper amount of materials used, and were corrected.  Sorry for those of you who liked only needing 50m to make a kevlar vest, or only 6h to make 3 leather into a baldric_holster

* Bugfixes, recipe simplication

Most 3 combinations of strap_large, small strap, clasp, fastener small, fastener large causes deduped_requirement_data error.*
Simplification of

legpouch_large, quiver, quiver_large, ammo_satchel, ammo_pouch, javelin_bag, stone_pouch, ammo_satchel_from leather, baldric_holster

recipies via
Fastener Small absorbs Clasp
Fastener Large absorbs Clasp

Strap shouldn't be absorbed, as it makes the recipe look "weird", and would then likely be reverted.

* Notable exception: "fastener_small", "strap_small" and "clasps".  So this means that whenever strap_large is added, such as belting or shoulder-straping something, something else has to give.

* Linting, and making the XL Kevlar vest requiring sewing
* Restore "Building with Visual Studio" heading

This heading was removed (probably by accident) in #46830.
Add an entry for the diary in the Action Menu
@a-chancey a-chancey merged commit a23bc0b into a-chancey:TailoringRecipeOverhaul-Cotton Feb 5, 2022
a-chancey pushed a commit that referenced this pull request Aug 6, 2022
* Update integrated.json

* alloy plating cbms

* clarify allows_natural_attacks flag

* Update bionics items to reflect new changes

* remove dupes from AFS

* Bionics apply and remove integrated armor

* remove a dupe

* well_distributed to bionic torso armor

* add a couple missed flags to armor

* fix an error

* further fixes

* astyle

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

* fix a description

* buff the cyborgs

* another integrated armor tweak

* coverage

* fix legs armor not including feet

* hopefully final correction

* undo cyborg changes for a later date

* add damage to some integrated parts

* add some comments to JSON entries

* JSON comments

* density fixes

* Alter the implementation to layered thin plates

* rework into layers of dermal plates, adjust conflicts

* clarify descriptions

* fixes

* lint

* lint

* lint

* coverage

* hopefully fix coverage failures

* syntax

* syntax

* coverage tests attempt #3

* syntax

* astyle

* typo

* add minimum 100% coverage layer

* carbon lattice

* adjust density and description

* convert flesh to nanotubes

* lower thickness

* remove BASHING from feet

* final coverage adjust

* subdermal carbon filament

* carbon filament

* revert alloy changes

* revert alloy plating changes

* remove alloy integrated armors

* clarify removeability

* filament allows natural attacks

* "//:" -> "//":

* commas

* fixes

* Update integrated.json

* Update integrated.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
a-chancey pushed a commit that referenced this pull request Nov 29, 2023
* Prevents game occasionally seemingly hanging when moving to new submaps

The reason for the previous problem was an infinite loop caused by:
1. `map::spawn_monsters_submap` for-loops the list of `current_submap->spawns`
2. for every spawned monster, it calls `monster::on_load`
3. `monster::on_load` calls `monster::try_reproduce`, which in turn calls
   `map::add_spawn`
4. So a new spawn is added, thus invalidating the iterator used in step 1
5. Undefined behavior caused by using invaliated iterators.

On my compiler (gcc 13.2.0), the above problem had the following effect:
* The reference `spawn_point &i` pointed to something totally different, so
  that in particular, `i.count` had garbage values
* Instead of `i.count` being reasonable values such as `3` or `1`, the above
  undefined behavior made it have values such as `925969776` or `-632214304`
* `i.count` is the upper bound for the inner for-loop in
  `map::spawn_monsters_submap`, so depending on the garbage value, it might
  seem like an infinite loop.

Stacktrace of app when frozen and problem happened:
```
 #0  0x000055a1eaf36dcb in creature_tracker::find(coords::coord_point<tripoint, (coords::origin)1, (coords::scale)0> const&) const ()
 #1  0x000055a1eaf39253 in Creature* creature_tracker::creature_at<Creature>(coords::coord_point<tripoint, (coords::origin)1, (coords::scale)0> const&, bool) ()
 #2  0x000055a1eaf393b5 in Creature* creature_tracker::creature_at<Creature>(tripoint const&, bool) ()
 #3  0x000055a1eb357a53 in map::spawn_monsters_submap(tripoint const&, bool, bool)::{lambda(tripoint const&)#1}::operator()(tripoint const&) const ()
 #4  0x000055a1eb3a976e in random_point(tripoint_range<tripoint> const&, std::function<bool (tripoint const&)> const&) ()
 #5  0x000055a1eb37dd2d in map::spawn_monsters_submap(tripoint const&, bool, bool) ()
 #6  0x000055a1eb37de77 in map::spawn_monsters(bool, bool) ()
 #7  0x000055a1eb093981 in game::update_map(int&, int&, bool) ()
 #8  0x000055a1eb094451 in game::update_map(Character&, bool) ()
 #9  0x000055a1eb09530f in game::place_player(tripoint const&, bool) ()
 #10 0x000055a1eb0b3a0e in game::walk_move(tripoint const&, bool, bool) ()
 #11 0x000055a1ead27490 in avatar_action::move(avatar&, map&, tripoint const&) ()
 #12 0x000055a1eb0f338c in game::do_regular_action(action_id&, avatar&, std::optional<tripoint> const&) ()
 #13 0x000055a1eb0f6e63 in game::handle_action() ()
 CleverRaven#14 0x000055a1eafbd9ea in do_turn() ()
 CleverRaven#15 0x000055a1eaa5ec13 in main ()
```

This commit instead changes the loop in step 1 above so that it explicitly
*not* uses iterators, but instead old-fashioned indexed loop. The intention
with the change is to allow other parts of the code to add items to the vector
`current_submap->spawns` while we are iterating it here. If new items are
added, they will be handled in later steps of the loop.
a-chancey pushed a commit that referenced this pull request Aug 6, 2024
Prevents segfault when performing `firstaid_activity_actor` but the
bandage tool disappeared. Backtrace of fixed segfault:
```
Thread 1 "cataclysm-tiles" received signal SIGSEGV, Segmentation fault.
(gdb) bt
 #0  0x0000555555ece5a4 in item::get_usable_item_helper<item> (use_name="heal", self=...) at src/item.cpp:11584
 #1  item::get_usable_item (this=0x0, use_name="heal") at src/item.cpp:11606
 #2  0x000055555599c6bf in firstaid_activity_actor::finish (this=0x55559b583f20, act=..., who=...) at src/activity_actor.cpp:6651
 #3  0x00005555564d8c6b in player_activity::do_turn (this=0x555558108218, you=...) at src/player_activity.cpp:391
 #4  0x0000555555ce3fa6 in do_turn () at src/do_turn.cpp:532
 #5  0x000055555577511a in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:873
```

An example where this happened was when the bandage was inside a
spillable container (clay canning pot), that spilled its contents when
starting the activity. Spiling the clay canning pot invalidates the
`item_location`. Backtrace of when the clay canning pot was spilled:
```
 #0  item_pocket::get_name (this=0x555557fa7540) at src/item_pocket.cpp:2117
 #1  item_pocket::handle_liquid_or_spill (this=this@entry=0x555557fa7540, guy=..., avoid=0x555557fa8060) at src/item_pocket.cpp:806
 #2  0x0000555555a6aa60 in avatar_action::use_item (you=..., loc=..., method="heal") at src/avatar_action.cpp:1212
 #3  0x0000555555a6dda7 in avatar_action::eat_or_use (you=..., loc=...) at src/avatar_action.cpp:988
 #4  0x0000555555e3e1c5 in game::do_regular_action (this=this@entry=0x555557f94a60, act=@0x7fffffffd1b0: ACTION_EAT, player_character=..., mouse_target=std::optional [no contained value]) at src/handle_action.cpp:2479
 #5  0x0000555555e41260 in game::handle_action (this=0x555557f94a60) at src/handle_action.cpp:3176
 #6  0x0000555555ce422f in do_turn () at /usr/include/c++/13/bits/unique_ptr.h:199
 #7  0x000055555577511a in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:873
```
a-chancey pushed a commit that referenced this pull request Aug 6, 2024
Prevents segfault that could previously occur if the item being repaired
was invalidated. The target item being repaired could get invalidated
for various reasons, such as a follower moving it via zone sorting, the
item could burn up in a fire, etc.

Previous segfault that this commit attempts to prevent:
```
 #0  0x0000555555ef9057 in item::is_null (this=this@entry=0x0) at src/item.cpp:943
 #1  0x000055555602322c in repair_item_actor::can_repair_target (this=this@entry=0x555560003e80, pl=..., fix=..., print_msg=print_msg@entry=true, check_consumed_available=check_consumed_available@entry=true) at src/iuse_actor.cpp:2920
 #2  0x00005555560243c2 in repair_item_actor::repair (this=this@entry=0x555560003e80, pl=..., tool=..., fix=..., refit_only=refit_only@entry=false) at src/iuse_actor.cpp:3106
 #3  0x00005555559d5b55 in repair_item_finish (act=0x5555580cdf58, you=0x5555580cd890, no_menu=false) at src/activity_handlers.cpp:2477
 #4  0x0000555555a00f52 in std::function<void (player_activity*, Character*)>::operator()(player_activity*, Character*) const (this=<optimized out>, __args#0=<optimized out>, __args#0@entry=0x5555580cdf58, __args#1=<optimized out>, __args#1@entry=0x5555580cd890) at /usr/include/c++/13/bits/std_function.h:591
 #5  0x00005555559ff229 in activity_type::call_finish (this=<optimized out>, act=act@entry=0x5555580cdf58, you=you@entry=0x5555580cd890) at src/activity_type.cpp:168
 #6  0x00005555564e368b in player_activity::do_turn (this=0x5555580cdf58, you=...) at src/player_activity.cpp:393
 #7  0x0000555555cec856 in do_turn () at src/do_turn.cpp:532
 #8  0x0000555555776e74 in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:873
```

Instead, this commit adds a message shown to the player if the target
item is no longer valid for whatever reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.