mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 08:52:40 +01:00
(svn r23367) -Codechange: refactor GetSetting to ScriptInstance, to avoid global variable in script_controller
This commit is contained in:
@@ -11,14 +11,11 @@
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "../../string_func.h"
|
||||
#include "../../company_base.h"
|
||||
#include "../../company_func.h"
|
||||
#include "../../script/squirrel.hpp"
|
||||
#include "../../rev.h"
|
||||
|
||||
#include "script_controller.hpp"
|
||||
#include "../../ai/ai_instance.hpp"
|
||||
#include "../../ai/ai_config.hpp"
|
||||
#include "../../ai/ai.hpp"
|
||||
#include "../script_fatalerror.hpp"
|
||||
#include "../script_info.hpp"
|
||||
@@ -78,7 +75,7 @@ ScriptController::~ScriptController()
|
||||
|
||||
/* static */ int ScriptController::GetSetting(const char *name)
|
||||
{
|
||||
return AIConfig::GetConfig(_current_company)->GetSetting(name);
|
||||
return ScriptObject::GetActiveInstance()->GetSetting(name);
|
||||
}
|
||||
|
||||
/* static */ uint ScriptController::GetVersion()
|
||||
|
||||
Reference in New Issue
Block a user