Skip to content

Commit

Permalink
minimum changes needed to reenable building-hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
ab9rf committed Nov 7, 2024
1 parent fad06d1 commit 6931333
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ if(BUILD_SUPPORTED)
dfhack_plugin(autoslab autoslab.cpp)
dfhack_plugin(blueprint blueprint.cpp LINK_LIBRARIES lua)
dfhack_plugin(burrow burrow.cpp LINK_LIBRARIES lua)
#dfhack_plugin(building-hacks building-hacks.cpp LINK_LIBRARIES lua)
dfhack_plugin(building-hacks building-hacks.cpp LINK_LIBRARIES lua)
add_subdirectory(buildingplan)
dfhack_plugin(changeitem changeitem.cpp)
dfhack_plugin(changelayer changelayer.cpp)
Expand Down
18 changes: 9 additions & 9 deletions plugins/building-hacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ struct work_hook : df::building_workshopst{
df::general_ref_creaturest* ref = static_cast<df::general_ref_creaturest*>(DFHack::Buildings::getGeneralRef(this, general_ref_type::CREATURE));
if (ref)
{
info->produced = ref->unk_1;
info->consumed = ref->unk_2;
info->produced = ref->pop_id;
info->consumed = ref->num;
return true;
}
else
Expand Down Expand Up @@ -118,18 +118,18 @@ struct work_hook : df::building_workshopst{
df::general_ref_creaturest* ref = static_cast<df::general_ref_creaturest*>(DFHack::Buildings::getGeneralRef(this, general_ref_type::CREATURE));
if (ref)
{
ref->unk_1 = produced;
ref->unk_2 = consumed;
ref->pop_id = produced;
ref->num = consumed;
}
else
{
ref = df::allocate<df::general_ref_creaturest>();
ref->unk_1 = produced;
ref->unk_2 = consumed;
ref->pop_id = produced;
ref->num = consumed;
general_refs.push_back(ref);
}
}
DEFINE_VMETHOD_INTERPOSE(uint32_t,getImpassableOccupancy,())
DEFINE_VMETHOD_INTERPOSE(df::tile_building_occ,getImpassableOccupancy,())
{
if(auto def = find_def())
{
Expand Down Expand Up @@ -260,9 +260,9 @@ struct work_hook : df::building_workshopst{
}
INTERPOSE_NEXT(updateAction)();
}
DEFINE_VMETHOD_INTERPOSE(void, drawBuilding, (df::building_drawbuffer *db, int16_t unk))
DEFINE_VMETHOD_INTERPOSE(void, drawBuilding, (uint32_t curtick, df::building_drawbuffer *db, int16_t unk))
{
INTERPOSE_NEXT(drawBuilding)(db, unk);
INTERPOSE_NEXT(drawBuilding)(curtick, db, unk);

if (auto def = find_def())
{
Expand Down

0 comments on commit 6931333

Please sign in to comment.