This commit is contained in:
aozhiwei 2023-03-04 10:31:48 +08:00
parent 8b580ce126
commit f1902a4289
2 changed files with 9 additions and 2 deletions

View File

@ -52,7 +52,14 @@ public:
void Transform(std::shared_ptr<a8::lisp::Value> node)
{
if (node->IsType(a8::lisp::ValueType::kSymbol)) {
auto && symbol = std::any_cast<a8::lisp::Symbol>(node->value);
auto&& symbol = std::any_cast<a8::lisp::Symbol>(node->value);
int idx = mt::SkillNumber::GetAttrIdxByName(symbol.name);
if (idx < 0) {
abort();
}
auto func_call_exprs = std::make_shared<a8::lisp::List::element_type>();
node->Assign(func_call_exprs);
} else if (node->IsType(a8::lisp::ValueType::kList)) {
auto list = std::any_cast<a8::lisp::List>(node->value);
for (auto child_node : *list) {

View File

@ -43,7 +43,7 @@ namespace mt
void Init1();
float GetAttrByIdx(int idx);
int GetAttrIdxByName(const std::string& name);
static int GetAttrIdxByName(const std::string& name);
};