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

Get roofs generated for basecamps #72724

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -2396,7 +2396,10 @@ bool generate_uniform_omt( const tripoint_abs_sm &p, const oter_id &terrain_type
class tinymap : private map
{
friend class editmap;
public:
protected:
tinymap(int mapsize, bool zlev) : map(mapsize, zlev) {};
PatrikLundell marked this conversation as resolved.
Show resolved Hide resolved

public:
PatrikLundell marked this conversation as resolved.
Show resolved Hide resolved
tinymap() : map( 2, false ) {}
bool inbounds( const tripoint &p ) const override;
bool inbounds( const tripoint_omt_ms &p ) const;
Expand Down Expand Up @@ -2637,4 +2640,17 @@ class fake_map : public tinymap
~fake_map() override;
static constexpr int fake_map_z = -OVERMAP_DEPTH;
};

/**
* Smallmap is similar to tinymap in that it covers a single overmap terrain (OMT) tile, but differs
* from it in that it covers all Z levels, not just a single one. It's intended usage is for cases
* where you need to operate on an OMT, but cannot guarantee you needs are restricted to a single
* Z level.
* The smallmap's natural relative reference system is the tripoint_omt_ms one.
*/
class smallmap : public tinymap
{
public:
smallmap() : tinymap(2, true) {}
PatrikLundell marked this conversation as resolved.
Show resolved Hide resolved
};
#endif // CATA_SRC_MAP_H
8 changes: 4 additions & 4 deletions src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7688,8 +7688,8 @@ bool update_mapgen_function_json::update_map(
return false;
}

std::unique_ptr<tinymap> p_update_tmap = std::make_unique<tinymap>();
tinymap &update_tmap = *p_update_tmap;
std::unique_ptr<smallmap> p_update_tmap = std::make_unique<smallmap>();
smallmap &update_tmap = *p_update_tmap;

update_tmap.load( omt_pos, true );
update_tmap.rotate( 4 - rotation );
Expand Down Expand Up @@ -7826,8 +7826,8 @@ bool apply_construction_marker( const update_mapgen_id &update_mapgen_id,
mapgendata fake_md( base_fake_md, args );
fake_md.skip = { mapgen_phase::zones };

std::unique_ptr<tinymap> p_update_tmap = std::make_unique<tinymap>();
tinymap &update_tmap = *p_update_tmap;
std::unique_ptr<smallmap> p_update_tmap = std::make_unique<smallmap>();
smallmap &update_tmap = *p_update_tmap;

update_tmap.load( omt_pos, true );
update_tmap.rotate( 4 - rotation );
Expand Down
Loading