(svn r26617) -Fix [FS#5973]: [Script] Loading/parsing of info .nuts was done in the same VM, causing e.g. constants to break the loading of info of other scripts
This commit is contained in:
@@ -335,12 +335,17 @@ bool Squirrel::CreateClassInstance(const char *class_name, void *real_instance,
|
||||
}
|
||||
|
||||
Squirrel::Squirrel(const char *APIName) :
|
||||
global_pointer(NULL),
|
||||
print_func(NULL),
|
||||
crashed(false),
|
||||
overdrawn_ops(0),
|
||||
APIName(APIName)
|
||||
{
|
||||
this->Initialize();
|
||||
}
|
||||
|
||||
void Squirrel::Initialize()
|
||||
{
|
||||
this->global_pointer = NULL;
|
||||
this->print_func = NULL;
|
||||
this->crashed = false;
|
||||
this->overdrawn_ops = 0;
|
||||
this->vm = sq_open(1024);
|
||||
|
||||
/* Handle compile-errors ourself, so we can display it nicely */
|
||||
@@ -548,12 +553,23 @@ bool Squirrel::LoadScript(const char *script)
|
||||
}
|
||||
|
||||
Squirrel::~Squirrel()
|
||||
{
|
||||
this->Uninitialize();
|
||||
}
|
||||
|
||||
void Squirrel::Uninitialize()
|
||||
{
|
||||
/* Clean up the stuff */
|
||||
sq_pop(this->vm, 1);
|
||||
sq_close(this->vm);
|
||||
}
|
||||
|
||||
void Squirrel::Reset()
|
||||
{
|
||||
this->Uninitialize();
|
||||
this->Initialize();
|
||||
}
|
||||
|
||||
void Squirrel::InsertResult(bool result)
|
||||
{
|
||||
sq_pushbool(this->vm, result);
|
||||
@@ -587,11 +603,6 @@ bool Squirrel::HasScriptCrashed()
|
||||
return this->crashed;
|
||||
}
|
||||
|
||||
void Squirrel::ResetCrashed()
|
||||
{
|
||||
this->crashed = false;
|
||||
}
|
||||
|
||||
void Squirrel::CrashOccurred()
|
||||
{
|
||||
this->crashed = true;
|
||||
|
Reference in New Issue
Block a user