mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: move block a bit lower to increase readability
It was rather confusing that "library_name" was calculated, and then not used to do the FindLibrary() call. Flipping those two blocks around makes it a bit more sane to read.
This commit is contained in:
parent
8c0e4ab07f
commit
29e3331055
|
@ -111,11 +111,6 @@ ScriptController::~ScriptController()
|
||||||
Squirrel *engine = ScriptObject::GetActiveInstance()->engine;
|
Squirrel *engine = ScriptObject::GetActiveInstance()->engine;
|
||||||
HSQUIRRELVM vm = engine->GetVM();
|
HSQUIRRELVM vm = engine->GetVM();
|
||||||
|
|
||||||
/* Internally we store libraries as 'library.version' */
|
|
||||||
char library_name[1024];
|
|
||||||
seprintf(library_name, lastof(library_name), "%s.%d", library, version);
|
|
||||||
strtolower(library_name);
|
|
||||||
|
|
||||||
ScriptInfo *lib = ScriptObject::GetActiveInstance()->FindLibrary(library, version);
|
ScriptInfo *lib = ScriptObject::GetActiveInstance()->FindLibrary(library, version);
|
||||||
if (lib == nullptr) {
|
if (lib == nullptr) {
|
||||||
char error[1024];
|
char error[1024];
|
||||||
|
@ -123,6 +118,11 @@ ScriptController::~ScriptController()
|
||||||
throw sq_throwerror(vm, error);
|
throw sq_throwerror(vm, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Internally we store libraries as 'library.version' */
|
||||||
|
char library_name[1024];
|
||||||
|
seprintf(library_name, lastof(library_name), "%s.%d", library, version);
|
||||||
|
strtolower(library_name);
|
||||||
|
|
||||||
/* Get the current table/class we belong to */
|
/* Get the current table/class we belong to */
|
||||||
HSQOBJECT parent;
|
HSQOBJECT parent;
|
||||||
sq_getstackobj(vm, 1, &parent);
|
sq_getstackobj(vm, 1, &parent);
|
||||||
|
|
Loading…
Reference in New Issue