Skip to content

Commit

Permalink
Reverted the "performance optimization" changes, added two Asserts, r…
Browse files Browse the repository at this point in the history
…emoved team determining every frame
  • Loading branch information
JonathanSteinbuch committed Dec 4, 2020
1 parent e515248 commit 9d6b2d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions libs/s25main/EconomyModeHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ void EconomyModeHandler::Serialize(SerializedGameData& sgd) const

void EconomyModeHandler::DetermineTeams()
{
RTTR_Assert(economyModeTeams.empty());
for(unsigned i = 0; i < gwg->GetNumPlayers(); ++i)
{
if(gwg->GetPlayer(i).isUsed())
Expand Down Expand Up @@ -200,9 +201,6 @@ void EconomyModeHandler::UpdateAmounts()
}
}

// Compute Teams
DetermineTeams();

// Compute the amounts for the teams
std::fill(maxAmountsATeamCollected.begin(), maxAmountsATeamCollected.end(), 0);
for(auto& team : economyModeTeams)
Expand Down
2 changes: 2 additions & 0 deletions libs/s25main/ingameWindows/iwEconomicProgress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ void iwEconomicProgress::Msg_PaintBefore()
const std::vector<EconomyModeHandler::EconTeam>& economyModeTeams = eH->GetTeams();
const GamePlayer& mainPlayer = gwv.GetPlayer();

RTTR_Assert(economyModeTeams.size() == teamOrder.size());

// make sure the amounts are current
eH->UpdateAmounts();

Expand Down

0 comments on commit 9d6b2d8

Please sign in to comment.