Skip to content

Commit

Permalink
safify buildingplan data access
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Jan 13, 2024
1 parent 60dcdbd commit 53744bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions plugins/buildingplan/buildingplan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ static Tasks tasks;
void PlannedBuilding::remove(color_ostream &out) {
DEBUG(control,out).print("removing persistent data for building %d\n", id);
World::DeletePersistentData(bld_config);
if (planned_buildings.count(id))
planned_buildings.erase(id);
planned_buildings.erase(id);
}

static const int32_t CYCLE_TICKS = 599; // twice per game day
Expand Down
2 changes: 1 addition & 1 deletion plugins/buildingplan/plannedbuilding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ PlannedBuilding::PlannedBuilding(color_ostream &out, df::building *bld, HeatSafe
bld_config.set_int(BLD_CONFIG_ID, id);
bld_config.set_int(BLD_CONFIG_HEAT, heat_safety);
bld_config.set_str(serialize(vector_ids, item_filters));
DEBUG(control,out).print("serialized state for building %d: %s\n", id, bld_config.val().c_str());
DEBUG(control,out).print("serialized state for building %d: %s\n", id, bld_config.get_str().c_str());
}

PlannedBuilding::PlannedBuilding(color_ostream &out, PersistentDataItem &bld_config)
Expand Down

0 comments on commit 53744bb

Please sign in to comment.