Support for new version of CreatureLib.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -85,18 +85,18 @@ void AngelScripResolver::RegisterTypes() {
|
||||
BasicScriptClass::Register(_engine);
|
||||
}
|
||||
|
||||
AngelScriptTypeInfo* AngelScripResolver::GetTypeInfo(const std::string& name, const std::string& decl) {
|
||||
auto find = _types.find(decl);
|
||||
AngelScriptTypeInfo* AngelScripResolver::GetTypeInfo(const ConstString& name, const std::string& decl) {
|
||||
auto find = _types.find(name);
|
||||
if (find != _types.end()) {
|
||||
return find->second;
|
||||
}
|
||||
auto type = _mainModule->GetTypeInfoByDecl(decl.c_str());
|
||||
if (type == nullptr) {
|
||||
_types.insert({decl, nullptr});
|
||||
_types.insert({name, nullptr});
|
||||
return nullptr;
|
||||
}
|
||||
auto typeinfo = new AngelScriptTypeInfo(name, type);
|
||||
_types.insert({decl, typeinfo});
|
||||
_types.insert({name, typeinfo});
|
||||
return typeinfo;
|
||||
}
|
||||
void AngelScripResolver::MessageCallback(const asSMessageInfo* msg, void* param) {
|
||||
@@ -120,9 +120,9 @@ static constexpr const char* GetCategoryNamespace(ScriptCategory category) {
|
||||
}
|
||||
}
|
||||
|
||||
CreatureLib::Battling::Script* AngelScripResolver::LoadScript(ScriptCategory category, const std::string& scriptName) {
|
||||
CreatureLib::Battling::Script* AngelScripResolver::LoadScript(ScriptCategory category, const ConstString& scriptName) {
|
||||
std::stringstream decl;
|
||||
decl << GetCategoryNamespace(category) << "::" << scriptName;
|
||||
decl << GetCategoryNamespace(category) << "::" << scriptName.c_str();
|
||||
auto typeInfo = GetTypeInfo(scriptName, decl.str());
|
||||
if (typeInfo == nullptr)
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user