Script: Add ScriptInstance field for script type
This commit is contained in:
@@ -49,7 +49,7 @@ static void PrintFunc(bool error_msg, const SQChar *message)
|
||||
ScriptController::Print(error_msg, message);
|
||||
}
|
||||
|
||||
ScriptInstance::ScriptInstance(const char *APIName) :
|
||||
ScriptInstance::ScriptInstance(const char *APIName, ScriptType script_type) :
|
||||
engine(nullptr),
|
||||
versionAPI(nullptr),
|
||||
controller(nullptr),
|
||||
@@ -63,6 +63,7 @@ ScriptInstance::ScriptInstance(const char *APIName) :
|
||||
in_shutdown(false),
|
||||
callback(nullptr),
|
||||
APIName(APIName),
|
||||
script_type(script_type),
|
||||
allow_text_param_mismatch(false)
|
||||
{
|
||||
this->storage = new ScriptStorage();
|
||||
@@ -91,7 +92,7 @@ void ScriptInstance::Initialize(const char *main_script, const char *instance_na
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(this->APIName, "GS") == 0) {
|
||||
if (this->script_type == ST_GS) {
|
||||
if (strcmp(instance_name, "BeeRewardClass") == 0) {
|
||||
this->LoadCompatibilityScripts("brgs", GAME_DIR);
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include <variant>
|
||||
#include <list>
|
||||
#include <squirrel.h>
|
||||
#include "squirrel.hpp"
|
||||
#include "script_suspend.hpp"
|
||||
|
||||
#include "../command_type.h"
|
||||
@@ -45,7 +46,7 @@ public:
|
||||
/**
|
||||
* Create a new script.
|
||||
*/
|
||||
ScriptInstance(const char *APIName);
|
||||
ScriptInstance(const char *APIName, ScriptType script_type);
|
||||
virtual ~ScriptInstance();
|
||||
|
||||
/**
|
||||
@@ -296,6 +297,7 @@ private:
|
||||
Script_SuspendCallbackProc *callback; ///< Callback that should be called in the next tick the script runs.
|
||||
size_t last_allocated_memory; ///< Last known allocated memory value (for display for crashed scripts)
|
||||
const char *APIName; ///< Name of the API used for this squirrel.
|
||||
ScriptType script_type; ///< Script type.
|
||||
bool allow_text_param_mismatch; ///< Whether ScriptText parameter mismatches are allowed
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user