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

Catching up to current version #2

Merged
merged 430 commits into from
Sep 20, 2019
Merged

Conversation

Maleclypse
Copy link
Owner

Summary

Purpose of change

Describe the solution

Describe alternatives you've considered

Additional context

ZhilkinSerg and others added 30 commits September 10, 2019 09:19
* crash fix for NPC on mission dismounting with no horse

* more protection on the dismount
* uncap drying chance

* chance to dry when on fire change from 40% to 100%
Jsonified hazardous waste sarcophagus computer messages
Simplify sterilizing CBM behind the scene logic
* Robofac Mercenary

* Rename file

* Apply suggestions from code review

Thanks  as always Night-Pryanik

Co-Authored-By: Anton Burmistrov <Night_Pryanik@mail.ru>

* Update NPC_ROBOFAC_MERC_1.json
hacking: change the electrohack formula to make sense
Added uncraft recipes for platinum jewelry
* Stricter json error enforcement

Throw errors in more cases for json read problems.

To catch errors sooner when there are typos or similar issues in the
game data.

* Update BEGGAR_1_Reena_Sandhu.json

* Update BEGGAR_3_Luo_Meizhen.json
* ApocPrice added

Adds "price_postapoc" to all ammo types, used existing price as price_postapoc" guesstimated pre cataclysm price with current prices and inflation and sensibility.  Example rounded 9mm to $1 rather than put in 18 cents. If someone wants to make use of these feel free to edit prices. This was more about building infrastructure.
* Remove speaker effect sentinel in cyborg dialog
The jumper cable was not working - you could attach it to a vehicle, but
past that, without the cable charger CBM, you could not do anything but
detach it from that vehicle. This changes it to allow you to attach it
to a vehicle without having the CBM.
Fix jumper cable not working without bio_cable CBM
* Update m202_flash definition

* Add M202A1 TALON UGV

* Move m202_flash and m235tpa to new files

* Bring talon_m202a1 ID in line with other monsters

* Add mon_talon_m202a1 spawns

* Add new PYROPHORIC effect for M74 rockets

* Use correct rocket clips in M202A1

* Add m74_clip spawns
Throttle NPC item search activity alternative
Implement debug map editor preview for Tiles
Professions start with magazines/holsters loaded with their items + missing batteries
harakka and others added 11 commits September 20, 2019 19:58
* Add washcloth

Washcloth does the same job as a sponge, but can be crafted from a rag.

* Add sponge as option to wash kit recipe
* Reworded slight calorie deficit message

* Astyle

* Added different starving messages for empty and non-empty stomach

* Less strict check

Also synonym to exhausted

* Reworded once again

* Update src/player.cpp

Co-Authored-By: matskuman5 <selinmatias5@gmail.com>

* Update src/player.cpp

Co-Authored-By: matskuman5 <selinmatias5@gmail.com>

* Use temp string variable
Enable Magiclysm on one Travis job
* Add a new_centered_win function

This is intended to simplify window creation for this common use case.

* Add stats_tracker::valid_scores

Scores are often not meaningful or computed incorrectly if they started
to exist partway through a game.  Therefore, note which scores existed
when the game started, and only report those that existed then and still
exist now.

* Add scrolling_text_view

This is a text view with built-in scrollbar which can be used in the
simplest cases when wanting to fit text into an otherwise-too-small
area.

This is actually a fairly rare situation in CDDA, because normally
scrolling regions contain some sort of selected item, and this doesn't
cater for that.

* Replace kills screen with new scores screen

Re-purpose the kills screen keybinding ')' to open a new UI that can
display kills as before, but can also display the new scores info.
Fixes #29898
(again)

Electrohack usage was converted to an activity, but the formula for
success was made into a copy of the old, bad formula.  Since
iexamine::hack_attempt() has the correct formula and was already
in a header used by activity_handlers.cpp, get rid of try_hack
and use hack_attempt() in all cases.

Remove some unnecessary if clauses in the process.
activity handler: use the iexamine hack success code
…ck (#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 b8d1f58.

It's a bad idea to save raw strings, because translation will
break if they change.
More faction fixes - serialize faction name, and load stubs for vehicle and item ownership
* Check premature translation of strings loaded from json

* Fix premature translation of fault names and descriptions

* Clarify error message

* Fix premature translation of plant names in item seed data

* Fix premature translation of transform use action messages and menu text

* Fix premature translation of NPC template unique names / name suffixes

Also properly implemented NPC template gender override

* Read NPC talk text directly into translation objects

* Fix premature translation of profession names and descriptions

* Read relic name overrides directly into translation objects

* Fix premature translation of scenario descriptions, character names, and starting location names

* Fix premature translation of speech text

* Fix premature translation of tutorial messages

* Fix premature translation of vitamin names

* Fix json extraction script
@Maleclypse Maleclypse merged commit d195e49 into Maleclypse:master Sep 20, 2019
Maleclypse pushed a commit that referenced this pull request Nov 8, 2019
Maleclypse pushed a commit that referenced this pull request Nov 8, 2019
merge from cataclysm master
Maleclypse pushed a commit that referenced this pull request Dec 17, 2019
Maleclypse pushed a commit that referenced this pull request Apr 12, 2020
Maleclypse pushed a commit that referenced this pull request May 11, 2020
The function `are_requirements_nearby` accesses `player::backlog::front()`, which causes UB when the `backlog` list is empty.

This is usually checked by the caller, but there is at least one way to reach this function without that check:

```
#2  0x000000000083dfaa in string_id<activity_type>::operator== (rhs=..., this=0xdf1b460) at src/player_activity.h:93
#3  are_requirements_nearby (loot_spots=std::vector of length 21, capacity 32 = {...}, needed_things=..., p=..., activity_to_restore=..., in_loot_zones=true, src_loc=...)
    at src/activity_item_handling.cpp:1113
#4  0x0000000000843a46 in generic_multi_activity_check_requirement (p=..., act_id=..., act_info=..., src=..., src_loc=...,
    src_set=std::unordered_set with 1 element = {...}, check_only=false) at src/activity_item_handling.cpp:2676
#5  0x0000000000852813 in generic_multi_activity_handler (act=..., p=..., check_only=check_only@entry=false) at src/activity_item_handling.cpp:2885
#6  0x0000000000800896 in activity_handlers::multiple_butcher_do_turn (act=<optimized out>, p=<optimized out>) at src/activity_handlers.cpp:3822
#7  0x000000000082b248 in std::_Function_handler<void (player_activity*, player*), void (*)(player_activity*, player*)>::_M_invoke(std::_Any_data const&, player_activity*&&, player*&&) (__functor=..., __args#0=<optimized out>, __args#1=<optimized out>) at /usr/include/c++/8/bits/std_function.h:88
#8  0x00000000008630e3 in std::function<void (player_activity*, player*)>::operator()(player_activity*, player*) const (this=<optimized out>, __args#0=<optimized out>,
    __args#0@entry=0xdf1b330, __args#1=<optimized out>, __args#1@entry=0xdf1ae50) at /usr/include/c++/8/bits/std_function.h:260
#9  0x0000000000860306 in activity_type::call_do_turn (this=0x2c3c930, act=act@entry=0xdf1b330, p=p@entry=0xdf1ae50) at src/activity_type.cpp:118
#10 0x00000000014a968b in player_activity::do_turn (this=this@entry=0xdf1b330, p=...) at src/player_activity.cpp:237
#11 0x00000000013092a4 in npc::do_player_activity (this=this@entry=0xdf1ae50) at src/npcmove.cpp:3299
#12 0x0000000001322a07 in npc::execute_action (this=this@entry=0xdf1ae50, action=<optimized out>, action@entry=npc_player_activity) at src/npcmove.cpp:1237
#13 0x000000000132690a in npc::move (this=this@entry=0xdf1ae50) at src/npcmove.cpp:907
```

This adds a simple check within the function.
Maleclypse pushed a commit that referenced this pull request May 23, 2020
Maleclypse pushed a commit that referenced this pull request Jun 2, 2020
Maleclypse pushed a commit that referenced this pull request Oct 4, 2020
Maleclypse pushed a commit that referenced this pull request Nov 19, 2020
Maleclypse pushed a commit that referenced this pull request Nov 21, 2021
@github-actions github-actions bot mentioned this pull request Jul 8, 2023
Maleclypse pushed a commit that referenced this pull request Sep 28, 2023
* Recover stuff (#2)

* Make neoprene closer to rubber (as it is a sort of rubber)

* Whoops...

* Linings for neoprene (wetsuits), environmental buffs, material adjustments

* Apply suggestions from code review

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

* Thanks to dictionary

* Duplicate removal

* Another duplicate

* Make diving socks vehave like NORMAL layer boots, compatibility with boots fix

* Updated night vision/IR goggles to not break in water

* Documented TOUGH_FEET clothing flag

* Technical shorts, XL/XS varieties and more thickness varieties!

* Quickfix

* Another fix

* Fix

* Technical shorts pockets now provide some protection too.

* Update dictionary.txt

* Apply suggestions from code review

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

* Update storage.json

* Update custom_storage.json

* Light Kevlar wetsuit, Kevlar wetsuits retouch

* Nylon thickness adjustment, encumbrance and pocket changes

* Misc adjustments to Kevlar wetsuits

* Custom diving boots initial addition

* Update custom_bodysuits.json

* Update swimming.json

* Initial implementation of survivor diving gloves

* Update custom_bodysuits.json

* Kevlar hoods initial implementation

* Whoops

* Diving leg rig

* Encumbrance for technical shorts bungees

* Whoops

* Update custom_bodysuits.json

* Waterproof camera case

* Update boots.json

* Update flags.json

* Fins for boots

* Update flags.json

* Custom swim fins

* Fix

* Fix

* Another fix

* Fix

* Update dictionary.txt

* Namings

* Glove namings

* Boot namings

* Naming convention change

* Update custom_headgear.json

* Update custom_bodysuits.json

* Update custom_boots.json

* Namings, wordings, and other stuff.

* Update custom_gloves.json

* Update materials.json

* Solving coverage weirdness

* Solving material weirdness

* Moving fins to swimming.json

* Arrival of fins to swimming.json, small tweak

* Custom fin attachment tweak

* Update flags.json

* Head straps for stuff

* Update flags.json

* Update custom_headgear.json

* Diving flashlights

* Flags, more flags

* Wrist mount for a flashlight

* Update dictionary.txt

* Update tool_armor.json

* Apply suggestions from code review

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

* Fix

* Fixes

* Update data/json/items/tool/lighting.json

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

* Update tool_armor.json

* Fix

* Update dictionary.txt

* Add IR goggles to hunting shop loot tables

* Fix

* Fix

* Now swim goggles provide eye protection.

* Survivor wetsuit adjustments and new recipes

* Remove redundant commas

* New wetsuit gloves recipes and their varieties

* Apply suggestions from code review

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

* Update containers.json

---------

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

* Readd camera case

* Fix

* Wetsuit boot recipes

* Adjust wetsuit gloves crafting cost

* Update hands.json

* Update feet.json

* Update hands.json

* Update survivor.json

* Wetsuit hood recipes

* Update head.json

* Update hands.json

* Update head.json

* Update hands.json

* Update head.json

* Update feet.json

* Update head.json

* Wetsuits and thick wetsuit crafts

* Fullface divemasks initial introduction

* Update survivor.json

* Nestening of unnested new stuff so checker does not freak out

* Update data/json/recipes/nested.json

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

* Fix

* Fix

* Apply suggestions from code review

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

* Update data/json/recipes/armor/feet.json

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

* Update data/json/recipes/armor/feet.json

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

* Update storage.json

* Fix

* Fix

* fix `cannot assign explicit value the same as default or inherited value`

* Fix `deduped_requirement_data generated too many alternatives` by replacing not waterproof clasps with hand made waterproof one

---------

Co-authored-by: randomtyper <59539398+randomtyper@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Maleclypse pushed a commit that referenced this pull request Nov 21, 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() ()
 #14 0x000055a1eafbd9ea in do_turn() ()
 #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.
Maleclypse pushed a commit that referenced this pull request Dec 18, 2023
* Fix charges for fermenting/distilling recipes

* Update #2

I'm an idiot.
Anyways, correction for absence of distilling/evaporation (that's a different process/recipe) and some comment clean-up.
Maleclypse pushed a commit that referenced this pull request Jan 2, 2024
Prevents segfault that previously happened when pouring liquid to ground
from AIM using "examine" menu.

Previous segfault being fixed:
```
 #0  __gnu_cxx::__atomic_add_dispatch () at /usr/include/c++/13/ext/atomicity.h:111
 #1  std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy () at /usr/include/c++/13/bits/shared_ptr_base.h:152
 #2  0x00005652b2df5540 in std::shared_ptr<item_location::impl>::shared_ptr () at /usr/include/c++/13/bits/shared_ptr.h:204
 #3  item_location::item_location () at src/item_location.h:30
 #4  item_location::impl::item_in_container::item_in_container () at src/item_location.cpp:612
 #5  item_location::item_location () at src/item_location.cpp:767
 #6  0x00005652b27fa6b1 in unload_activity_actor::unload () at src/activity_actor.cpp:3232
 #7  0x00005652b32eed69 in player_activity::do_turn () at src/player_activity.cpp:383
 #8  0x00005652b2b553e7 in do_turn () at src/do_turn.cpp:487
 #9  0x00005652b25ea589 in main () at src/main.cpp:798
```

The problem before was that the reference to `target` in
`unload_activity_actor::unload` was an invalid reference. This was
caused by:
  1. `unload_activity_actor::finish` calls `act.set_to_null()`.
  2. That sets the player activity to `null` type (=no current activity)
  3. `unload_activity_actor::unload` is `static`, and takes `target` as
     a reference.
  4. `::unload` calls `Character::add_or_drop_with_msg` which leads to
     call chain: `liquid_handler::consume_liquid` -> `get_liquid_target`
     -> `choose_adjacent` -> `choose_direction`
     -> `temp_hide_advanced_inv` -> `advanced_inventory::temp_hide`
     -> `advanced_inventory::do_return_entry`
  5. `advanced_inventory::do_return_entry` assigns a new
     `ACT_ADV_INVENTORY` activity. This invalidates the previous
     `unload_activity_actor` because of pt 2 above.
  6. When static method `unload_activity_actor::unload` resumes after
     its call to `add_or_drop_with_msg`, the reference to `target` is
     invalid because of pt 5.

This commit attempt to fix the issue with invalidated `target` reference
by copying its value before invalidating the activity.
Maleclypse pushed a commit that referenced this pull request Jan 9, 2024
* Add missing was_loaded initialization

We forgot to initialize was_loaded in profession_group

I found this bug thanks to UndefinedBehaviorSanitizer
```c++
src/profession_group.h:8:8: runtime error: load of value 60, which is not a valid value for type 'bool'
    #0 0x6fa4312 in profession_group::profession_group(profession_group const&) src/profession_group.h:8
    #1 0x6fb241e in void std::__new_allocator<profession_group>::construct<profession_group, profession_group const&>(profession_group*, profession_group const&) /usr/include/c++/13/bits/new_allocator.h:187
    #2 0x6fb241e in void std::allocator_traits<std::allocator<profession_group> >::construct<profession_group, profession_group const&>(std::allocator<profession_group>&, profession_group*, profession_group const&) /usr/include/c++/13/bits/alloc_traits.h:537
    #3 0x6fb241e in void std::vector<profession_group, std::allocator<profession_group> >::_M_realloc_insert<profession_group const&>(__gnu_cxx::__normal_iterator<profession_group*, std::vector<profession_group, std::allocator<profession_group> > >, profession_group const&) /usr/include/c++/13/bits/vector.tcc:468
    #4 0x6fb2911 in std::vector<profession_group, std::allocator<profession_group> >::push_back(profession_group const&) /usr/include/c++/13/bits/stl_vector.h:1289
    #5 0x6fb2c14 in generic_factory<profession_group>::insert(profession_group const&) src/generic_factory.h:391
    #6 0x6fb61a7 in generic_factory<profession_group>::load(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/generic_factory.h:304
    #7 0x6fa0efd in profession_group::load_profession_group(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/profession_group.cpp:25
    #8 0x4294940 in void std::__invoke_impl<void, void (*&)(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(std::__invoke_other, void (*&)(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /usr/include/c++/13/bits/invoke.h:61
    #9 0x4294976 in std::enable_if<is_invocable_r_v<void, void (*&)(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>, void>::type std::__invoke_r<void, void (*&)(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(void (*&)(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /usr/include/c++/13/bits/invoke.h:111
    #10 0x4294976 in std::_Function_handler<void (JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), void (*)(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>::_M_invoke(std::_Any_data const&, JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /usr/include/c++/13/bits/std_function.h:290
    #11 0x4290c79 in std::function<void (JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>::operator()(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /usr/include/c++/13/bits/std_function.h:591
    #12 0x426934f in operator() src/init.cpp:227
    #13 0x426934f in __invoke_impl<void, DynamicDataLoader::add(const std::string&, const std::function<void(const JsonObject&, const std::__cxx11::basic_string<char>&)>&)::<lambda(const JsonObject&, const std::string&, const cata_path&, const cata_path&)>&, const JsonObject&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const cata_path&, const cata_path&> /usr/include/c++/13/bits/invoke.h:61
    #14 0x426934f in __invoke_r<void, DynamicDataLoader::add(const std::string&, const std::function<void(const JsonObject&, const std::__cxx11::basic_string<char>&)>&)::<lambda(const JsonObject&, const std::string&, const cata_path&, const cata_path&)>&, const JsonObject&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const cata_path&, const cata_path&> /usr/include/c++/13/bits/invoke.h:111
    #15 0x426934f in _M_invoke /usr/include/c++/13/bits/std_function.h:290
    #16 0x42904f3 in std::function<void (JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cata_path const&, cata_path const&)>::operator()(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cata_path const&, cata_path const&) const /usr/include/c++/13/bits/std_function.h:591
    #17 0x4284949 in DynamicDataLoader::load_object(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cata_path const&, cata_path const&) src/init.cpp:137
    #18 0x4285c32 in DynamicDataLoader::load_all_from_json(JsonValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, loading_ui&, cata_path const&, cata_path const&) src/init.cpp:540
    #19 0x4286744 in DynamicDataLoader::load_data_from_path(cata_path const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, loading_ui&) src/init.cpp:521
    #20 0x3ca25fa in game::load_data_from_dir(cata_path const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, loading_ui&) src/game.cpp:571
    #21 0x3d21130 in game::load_packs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<string_id<MOD_INFORMATION>, std::allocator<string_id<MOD_INFORMATION> > > const&, loading_ui&) src/game.cpp:3265
    #22 0x3d518b5 in game::load_world_modfiles(loading_ui&) src/game.cpp:3235
    #23 0x3e055d0 in game::setup() src/game.cpp:756
    #24 0x5111cc3 in main_menu::new_character_tab() src/main_menu.cpp:972
    #25 0x5127aea in main_menu::opening_screen() src/main_menu.cpp:863
    #26 0x50f1e5e in main src/main.cpp:792
    #27 0x7f7a489cfb89 in __libc_start_call_main (/lib64/libc.so.6+0x27b89) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c)
    #28 0x7f7a489cfc4a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c4a) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c)
    #29 0x1bec804 in _start (/home/cdda/git/Cataclysm-DDA/cataclysm-tiles+0x1bec804) (BuildId: 1a0225eb0946b150a1f9b1759d512b53fde7f1d0)
```

* Make overmap_terrain_coverage less likely to produce spurious errors

* Revert "Make overmap_terrain_coverage less likely to produce spurious errors"

This reverts commit 6134a08.
Maleclypse pushed a commit that referenced this pull request Jan 9, 2024
If melee_actori.is_grab is false grab.exclusive_grab and grab.respect_seatbelts
were not initialized. This was causing errors under -fsanitize=undefined

The solution initialize the booleans to value that match their defaults

```C++
src/mattack_actors.h:75:8: runtime error: load of value 190, which is not a valid value for type 'bool'
    #0 0x5a9b6fe in grab::grab(grab const&) src/mattack_actors.h:75
    #1 0x5ab7635 in melee_actor::melee_actor(melee_actor const&) src/mattack_actors.h:106
    #2 0x5ab8412 in std::__detail::_MakeUniq<melee_actor>::__single_object std::make_unique<melee_actor, melee_actor const&>(melee_actor const&) /usr/include/c++/13/bits/unique_ptr.h:1070
    #3 0x5a87e4c in melee_actor::clone() const src/mattack_actors.cpp:962
    #4 0x207632c in cata::clone_ptr<mattack_actor>::clone_ptr(cata::clone_ptr<mattack_actor> const&) src/clone_ptr.h:18
    #5 0x6085941 in mtype_special_attack::mtype_special_attack(mtype_special_attack const&) src/mattack_common.h:47
    #6 0x6085941 in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack, true>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&) /usr/include/c++/13/bits/stl_pair.h:559
    #7 0x6085a2b in void std::__new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > >::construct<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&>(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&) /usr/include/c++/13/bits/new_allocator.h:187
    #8 0x6085a2b in void std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > > >::construct<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&>(std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > >&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&) /usr/include/c++/13/bits/alloc_traits.h:537
    #9 0x6085a2b in void std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > >::_M_construct_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&>(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&) /usr/include/c++/13/bits/stl_tree.h:597
    #10 0x6085b06 in std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >* std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > >::_M_create_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&) /usr/include/c++/13/bits/stl_tree.h:614
    #11 0x6085b71 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > >::_Auto_node::_Auto_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&>(std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&) /usr/include/c++/13/bits/stl_tree.h:1637
    #12 0x6085c9d in std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > >::_M_emplace_hint_unique<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&>(std::_Rb_tree_const_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&) /usr/include/c++/13/bits/stl_tree.h:2462
    #13 0x608618f in std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, mtype_special_attack, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > >::emplace_hint<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&>(std::_Rb_tree_const_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&) /usr/include/c++/13/bits/stl_map.h:640
    #14 0x608618f in std::pair<std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> >, bool> std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, mtype_special_attack, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mtype_special_attack> > >::emplace<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mtype_special_attack const&) /usr/include/c++/13/bits/stl_map.h:601
    #15 0x5ff3881 in MonsterGenerator::add_attack(mtype_special_attack const&) src/monstergenerator.cpp:1312
    #16 0x5ffafa5 in MonsterGenerator::load_monster_attack(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/monstergenerator.cpp:1376
    #17 0x4262e91 in operator() src/init.cpp:466
    #18 0x4262e91 in __invoke_impl<void, DynamicDataLoader::initialize()::<lambda(const JsonObject&, const std::string&)>&, const JsonObject&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> /usr/include/c++/13/bits/invoke.h:61
    #19 0x4262e91 in __invoke_r<void, DynamicDataLoader::initialize()::<lambda(const JsonObject&, const std::string&)>&, const JsonObject&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> /usr/include/c++/13/bits/invoke.h:111
    #20 0x4262e91 in _M_invoke /usr/include/c++/13/bits/std_function.h:290
    #21 0x4290ce9 in std::function<void (JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>::operator()(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /usr/include/c++/13/bits/std_function.h:591
    #22 0x42693bf in operator() src/init.cpp:227
    #23 0x42693bf in __invoke_impl<void, DynamicDataLoader::add(const std::string&, const std::function<void(const JsonObject&, const std::__cxx11::basic_string<char>&)>&)::<lambda(const JsonObject&, const std::string&, const cata_path&, const cata_path&)>&, const JsonObject&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const cata_path&, const cata_path&> /usr/include/c++/13/bits/invoke.h:61
    #24 0x42693bf in __invoke_r<void, DynamicDataLoader::add(const std::string&, const std::function<void(const JsonObject&, const std::__cxx11::basic_string<char>&)>&)::<lambda(const JsonObject&, const std::string&, const cata_path&, const cata_path&)>&, const JsonObject&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const cata_path&, const cata_path&> /usr/include/c++/13/bits/invoke.h:111
    #25 0x42693bf in _M_invoke /usr/include/c++/13/bits/std_function.h:290
    #26 0x4290563 in std::function<void (JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cata_path const&, cata_path const&)>::operator()(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cata_path const&, cata_path const&) const /usr/include/c++/13/bits/std_function.h:591
    #27 0x42849b9 in DynamicDataLoader::load_object(JsonObject const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cata_path const&, cata_path const&) src/init.cpp:137
    #28 0x4285ca2 in DynamicDataLoader::load_all_from_json(JsonValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, loading_ui&, cata_path const&, cata_path const&) src/init.cpp:540
    #29 0x42867b4 in DynamicDataLoader::load_data_from_path(cata_path const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, loading_ui&) src/init.cpp:521
    #30 0x3ca266a in game::load_data_from_dir(cata_path const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, loading_ui&) src/game.cpp:571
    #31 0x3d211a0 in game::load_packs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<string_id<MOD_INFORMATION>, std::allocator<string_id<MOD_INFORMATION> > > const&, loading_ui&) src/game.cpp:3265
    #32 0x3d51925 in game::load_world_modfiles(loading_ui&) src/game.cpp:3235
    #33 0x3e05640 in game::setup() src/game.cpp:756
    #34 0x5111d33 in main_menu::new_character_tab() src/main_menu.cpp:972
    #35 0x5127b5a in main_menu::opening_screen() src/main_menu.cpp:863
    #36 0x50f1ece in main src/main.cpp:792
    #37 0x7fdc43fa9b89 in __libc_start_call_main (/lib64/libc.so.6+0x27b89) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c)
    #38 0x7fdc43fa9c4a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c4a) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c)
    #39 0x1bec874 in _start (/home/cdda/git/Cataclysm-DDA/cataclysm-tiles+0x1bec874) (BuildId: be24990d1723c8da00f3e8701793ab983cf64dcc)
```
Maleclypse added a commit that referenced this pull request Mar 3, 2024
* Added EOC that boosts spell leveling on cast depends on mana cost. After spell level 15 focus also affects this factor.

* Update data/mods/Magiclysm/eoc_spell_learn_boost.json

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

* Update data/mods/Magiclysm/eoc_spell_learn_boost.json

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

* Update data/mods/Magiclysm/eoc_spell_learn_boost.json

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

* Update data/mods/Magiclysm/eoc_spell_learn_boost.json

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

* lint

* spelling

Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>

* oops disinformation

* fix learning technical spells to the player by another EOCs

* fix learning technical spells to the player by another EOCs #2

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet