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

reenable building-hacks #5018

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
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