mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r24108) -Fix [FS#5142]: When starting GS or AI, always use the settings of the game, not the new-game settings.
This commit is contained in:
parent
c425368a17
commit
d7d89bc806
|
@ -39,7 +39,7 @@
|
||||||
/* Clients shouldn't start AIs */
|
/* Clients shouldn't start AIs */
|
||||||
if (_networking && !_network_server) return;
|
if (_networking && !_network_server) return;
|
||||||
|
|
||||||
AIConfig *config = AIConfig::GetConfig(company);
|
AIConfig *config = AIConfig::GetConfig(company, AIConfig::SSS_FORCE_GAME);
|
||||||
AIInfo *info = config->GetInfo();
|
AIInfo *info = config->GetInfo();
|
||||||
if (info == NULL || (rerandomise_ai && config->IsRandom())) {
|
if (info == NULL || (rerandomise_ai && config->IsRandom())) {
|
||||||
info = AI::scanner_info->SelectRandomAI();
|
info = AI::scanner_info->SelectRandomAI();
|
||||||
|
@ -283,7 +283,7 @@
|
||||||
{
|
{
|
||||||
/* Find the first company which doesn't exist yet */
|
/* Find the first company which doesn't exist yet */
|
||||||
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
||||||
if (!Company::IsValidID(c)) return AIConfig::GetConfig(c)->GetSetting("start_date");
|
if (!Company::IsValidID(c)) return AIConfig::GetConfig(c, AIConfig::SSS_FORCE_GAME)->GetSetting("start_date");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Currently no AI can be started, check again in a year. */
|
/* Currently no AI can be started, check again in a year. */
|
||||||
|
|
|
@ -222,7 +222,7 @@ void AIInstance::Died()
|
||||||
|
|
||||||
ShowAIDebugWindow(_current_company);
|
ShowAIDebugWindow(_current_company);
|
||||||
|
|
||||||
const AIInfo *info = AIConfig::GetConfig(_current_company)->GetInfo();
|
const AIInfo *info = AIConfig::GetConfig(_current_company, AIConfig::SSS_FORCE_GAME)->GetInfo();
|
||||||
if (info != NULL) {
|
if (info != NULL) {
|
||||||
ShowErrorMessage(STR_ERROR_AI_PLEASE_REPORT_CRASH, INVALID_STRING_ID, WL_WARNING);
|
ShowErrorMessage(STR_ERROR_AI_PLEASE_REPORT_CRASH, INVALID_STRING_ID, WL_WARNING);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
/* Clients shouldn't start GameScripts */
|
/* Clients shouldn't start GameScripts */
|
||||||
if (_networking && !_network_server) return;
|
if (_networking && !_network_server) return;
|
||||||
|
|
||||||
GameConfig *config = GameConfig::GetConfig();
|
GameConfig *config = GameConfig::GetConfig(GameConfig::SSS_FORCE_GAME);
|
||||||
GameInfo *info = config->GetInfo();
|
GameInfo *info = config->GetInfo();
|
||||||
if (info == NULL) return;
|
if (info == NULL) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue