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

map::place_items() called with an invalid chance (500) #36637

Closed
AMurkin opened this issue Jan 2, 2020 · 3 comments · Fixed by #36898
Closed

map::place_items() called with an invalid chance (500) #36637

AMurkin opened this issue Jan 2, 2020 · 3 comments · Fixed by #36898
Labels
<Bug> This needs to be fixed Items / Item Actions / Item Qualities Items and how they work and interact Map / Mapgen Overmap, Mapgen, Map extras, Map display Spawn Creatures, items, vehicles, locations appearing on map
Milestone

Comments

@AMurkin
Copy link
Contributor

AMurkin commented Jan 2, 2020

Describe the bug

Debug message(s) when traveling around the world.
    debug_write_backtrace(std::ostream&)
    ??:?
    DebugLog(DebugLevel, DebugClass)
    ??:?
    realDebugmsg(char const*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&)
    ??:?
    void realDebugmsg(char const*, char const*, char const*, char const*, int&)
    ??:?
    map::place_items(std::__cxx11::basic_string, std::allocator > const&, int, tripoint const&, tripoint const&, bool, time_point const&, int, int)
    ??:?
    map::place_items(std::__cxx11::basic_string, std::allocator > const&, int, point const&, point const&, bool, time_point const&, int, int)
    ??:?
    jmapgen_item_group::apply(mapgendata&, jmapgen_int const&, jmapgen_int const&) const
    ??:?
    jmapgen_objects::apply(mapgendata&) const
    ??:?
    jmapgen_objects::apply(mapgendata&, point const&) const
    ??:?
    mapgen_function_json::generate(mapgendata&)
    ??:?
    run_mapgen_func(std::__cxx11::basic_string, std::allocator > const&, mapgendata&)
    ??:?
    map::draw_map(mapgendata&)
    ??:?
    map::generate(tripoint const&, time_point const&)
    ??:?
    map::loadn(tripoint const&, bool)
    ??:?
    map::shift(point const&)
    ??:?
    game::update_map(int&, int&)
    ??:?
    game::update_map(player&)
    ??:?
    map::displace_vehicle(vehicle&, tripoint const&)
    ??:?
    map::move_vehicle(vehicle&, tripoint const&, tileray const&)
    ??:?
    vehicle::act_on_map()
    ??:?
Backtrace emission took 1 seconds.
src/mapgen.cpp:6401 [std::vector map::place_items(const items_location&, int, const tripoint&, const tripoint&, bool, const time_point&, int, int)] map::place_items() called with an invalid chance (500)
15:40:24.954 ERROR : src/mapgen.cpp:6401 [std::vector map::place_items(const items_location&, int, const tripoint&, const tripoint&, bool, const time_point&, int, int)] map::place_items() called with an invalid chance (500)
15:40:26.409 ERROR : src/mapgen.cpp:6401 [std::vector map::place_items(const items_location&, int, const tripoint&, const tripoint&, bool, const time_point&, int, int)] map::place_items() called with an invalid chance (500)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Travel around the world.

Expected behavior

No debug messages.

Versions and configuration

  • OS: Linux
    • OS Version: Distributor ID: LinuxMint; Description: Linux Mint 19.3 Tricia; Release: 19.3; Codename: tricia;
  • Game Version: 0.D-10189-gd2cb78a [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    "dda",
    "no_npc_food"
    ]

Additional context

Debug message source line:

debugmsg( "map::place_items() called with an invalid chance (%d)", chance );

"chance": 500 can be found here.

Docs describing a "chance" as optional one-in-??? chance to apply.

@Night-Pryanik Night-Pryanik added <Bug> This needs to be fixed Items / Item Actions / Item Qualities Items and how they work and interact Map / Mapgen Overmap, Mapgen, Map extras, Map display Spawn Creatures, items, vehicles, locations appearing on map labels Jan 2, 2020
@Zireael07
Copy link
Contributor

Why would one in 500 not be a valid setting? 😕

@AMurkin
Copy link
Contributor Author

AMurkin commented Jan 2, 2020

map::place_items(...) checks if( chance > 100 || chance <= 0 ) to show this debug message.
So it's not one-in-??? it seems.

@Fris0uman
Copy link
Contributor

So was it meant to be 1/500, meaning it should be changed to 1 to be rare, or was it meant to be very common stuff and should be changed to 100?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Items / Item Actions / Item Qualities Items and how they work and interact Map / Mapgen Overmap, Mapgen, Map extras, Map display Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
5 participants