Skip to content

Commit

Permalink
update to great reorg structures
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Feb 8, 2025
1 parent 194bde0 commit 1fe88a2
Show file tree
Hide file tree
Showing 43 changed files with 235 additions and 229 deletions.
5 changes: 3 additions & 2 deletions library/LuaApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ distribution.
#include "df/report_zoom_type.h"
#include "df/specific_ref.h"
#include "df/specific_ref_type.h"
#include "df/squad_use_flags.h"
#include "df/squad.h"
#include "df/unit.h"
#include "df/unit_misc_trait.h"
Expand Down Expand Up @@ -2442,7 +2443,7 @@ static int items_moveToBuilding(lua_State *state)
static int items_moveToInventory(lua_State *state) {
auto item = Lua::CheckDFObject<df::item>(state, 1);
auto unit = Lua::CheckDFObject<df::unit>(state, 2);
auto use_mode = (df::unit_inventory_item::T_mode)luaL_optint(state, 3, 0);
auto use_mode = (df::inv_item_role_type)luaL_optint(state, 3, 0);
int body_part = luaL_optint(state, 4, -1);
lua_pushboolean(state, Items::moveToInventory(item, unit, use_mode, body_part));
return 1;
Expand Down Expand Up @@ -2815,7 +2816,7 @@ int buildings_setSize(lua_State *state)
lua_pushinteger(state, size.x);
lua_pushinteger(state, size.y);
lua_pushinteger(state, area);
lua_pushinteger(state, Buildings::countExtentTiles(&bld->room, area));
lua_pushinteger(state, Buildings::countExtentTiles(bld, area));
return 5;
}
else
Expand Down
2 changes: 1 addition & 1 deletion library/RemoteTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ static command_result ListEnums(color_ostream &stream,
BITFIELD(cie_add_tag_mask1);
BITFIELD(cie_add_tag_mask2);

describe_bitfield<df::incident::T_flags>(out->mutable_death_info_flags());
describe_bitfield<df::incident_flag>(out->mutable_death_info_flags());

ENUM(profession);

Expand Down
2 changes: 1 addition & 1 deletion library/include/df/custom/creature_handler.methods.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
friend struct world_raws;
friend struct world;
5 changes: 2 additions & 3 deletions library/include/modules/Buildings.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ namespace df {
struct building;
struct building_cagest;
struct building_civzonest;
struct building_extents;
struct building_stockpilest;
struct item;
struct job_item;
Expand Down Expand Up @@ -112,7 +111,7 @@ DFHACK_EXPORT bool getCorrectSize(df::coord2d &size, df::coord2d &center,
* Checks if the tiles are free to be built upon.
*/
DFHACK_EXPORT bool checkFreeTiles(df::coord pos, df::coord2d size,
df::building_extents *ext = NULL,
df::building *bld,
bool create_ext = false,
bool allow_occupied = false,
bool allow_wall = false,
Expand All @@ -121,7 +120,7 @@ DFHACK_EXPORT bool checkFreeTiles(df::coord pos, df::coord2d size,
/**
* Returns the number of tiles included by the extent, or defval.
*/
DFHACK_EXPORT int countExtentTiles(df::building_extents *ext, int defval = -1);
DFHACK_EXPORT int countExtentTiles(df::building *bld, int defval = -1);

/**
* Checks if the building contains the specified tile. If the building has
Expand Down
2 changes: 1 addition & 1 deletion library/include/modules/Items.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ DFHACK_EXPORT bool moveToContainer(df::item *item, df::item *container);
DFHACK_EXPORT bool moveToBuilding(df::item *item, df::building_actual *building,
df::building_item_role_type use_mode = df::building_item_role_type::TEMP, bool force_in_building = false);
DFHACK_EXPORT bool moveToInventory(df::item *item, df::unit *unit,
df::unit_inventory_item::T_mode mode = df::unit_inventory_item::Hauled, int body_part = -1);
df::inv_item_role_type mode = df::inv_item_role_type::Hauled, int body_part = -1);

/// Remove item from jobs and inventories, hide and forbid.
/// Unless no_uncat, item is marked for garbage collection.
Expand Down
2 changes: 1 addition & 1 deletion library/include/modules/Job.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace DFHack
DFHACK_EXPORT bool listNewlyCreated(std::vector<df::job*> *pvec, int *id_var);

DFHACK_EXPORT bool attachJobItem(df::job *job, df::item *item,
df::job_item_ref::T_role role,
df::job_role_type role,
int filter_idx = -1, int insert_idx = -1);

DFHACK_EXPORT bool isSuitableItem(const df::job_item *item, df::item_type itype, int isubtype);
Expand Down
2 changes: 1 addition & 1 deletion library/include/modules/MapCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class BlockInfo
};
static GroundType getGroundType(int material);

typedef df::block_square_event_mineralst::T_flags DFVeinFlags;
typedef df::mineral_event_flag DFVeinFlags;

t_veintype veintype;
t_blockmaterials veinmats;
Expand Down
Loading

0 comments on commit 1fe88a2

Please sign in to comment.