Merge branch 'master' into jgrpp

# Conflicts:
#	src/lang/czech.txt
#	src/order_backup.h
#	src/settings_internal.h
#	src/string.cpp
#	src/viewport.cpp
This commit is contained in:
Jonathan G Rennison
2023-02-04 11:37:45 +00:00
28 changed files with 115 additions and 96 deletions

View File

@@ -85,18 +85,16 @@
PerformanceMeasurer framerate((PerformanceElement)(PFE_AI0 + c->index));
cur_company.Change(c->index);
c->ai_instance->GameLoop();
/* Occasionally collect garbage; every 255 ticks do one company.
* Effectively collecting garbage once every two months per AI. */
if ((AI::frame_counter & 255) == 0 && (CompanyID)GB(AI::frame_counter, 8, 4) == c->index) {
c->ai_instance->CollectGarbage();
}
} else {
PerformanceMeasurer::SetInactive((PerformanceElement)(PFE_AI0 + c->index));
}
}
cur_company.Restore();
/* Occasionally collect garbage; every 255 ticks do one company.
* Effectively collecting garbage once every two months per AI. */
if ((AI::frame_counter & 255) == 0) {
CompanyID cid = (CompanyID)GB(AI::frame_counter, 8, 4);
if (Company::IsValidAiID(cid)) Company::Get(cid)->ai_instance->CollectGarbage();
}
}
/* static */ uint AI::GetTick()