Skip to content

Commit

Permalink
add state ownership of admins.
Browse files Browse the repository at this point in the history
  • Loading branch information
gawquon committed Jul 22, 2024
1 parent d3cf8ec commit 3c04658
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions EU4ToVic3/Source/Output/outBuildings/outBuildings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ void outBuilding(std::ostream& output, const V3::Building& building)
output << "\t\t\tcreate_building = {\n";
output << "\t\t\t\tbuilding = \"" << building.getName() << "\"\n";

if (building.getShareholders().empty())
{
Log(LogLevel::Warning) << "Building " << building.getName() << " will be ignored by the game engine, no investor data.";
}
outShareholders(output, building);

output << "\t\t\t\treserves = " << 1 << "\n";
Expand Down
6 changes: 1 addition & 5 deletions EU4ToVic3/Source/V3World/EconomyManager/EconomyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,7 @@ void V3::EconomyManager::investCapital() const
for (const auto& building: subState->getBuildings())
{
const auto& type = buildingGroups.getAncestralCategory(building->getBuildingGroup()).value_or("");
if (type.empty())
{
Log(LogLevel::Warning) << "Unrecognized building group " << type << " when investing. B: " << building->getName();
}
else if (type == "bg_agriculture" || type == "bg_plantation" || type == "bg_ranching")
if (type == "bg_agriculture" || type == "bg_plantation" || type == "bg_ranching")
{
building->addInvestor(building->getLevel(), "aristocratic", subState->getHomeStateName(), country->getTag());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ void V3::Country::distributeGovAdmins(const double target, const int PMGeneratio
const auto govAdmin = std::make_shared<Building>();
govAdmin->setName("building_government_administration");
govAdmin->setLevel(levels);
govAdmin->addInvestor(levels, "national_service", substate->getHomeStateName(), this->tag);

substate->addBuilding(govAdmin);

Expand Down

0 comments on commit 3c04658

Please sign in to comment.