This commit is contained in:
aozhiwei 2023-03-06 14:02:26 +08:00
parent e428043c6a
commit 2be0891faf

View File

@ -84,23 +84,29 @@ public:
void Transform(std::shared_ptr<a8::lisp::Value> parent_node, std::shared_ptr<a8::lisp::Value> node)
{
if (node->IsType(a8::lisp::ValueType::kSymbol)) {
auto func_call_exprs = std::make_shared<a8::lisp::List::element_type>();
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>();
{
auto cproc = Find("!getSkillNumber");
auto cproc = Find(symbol.name);
if (!cproc) {
abort();
}
if (!cproc->IsType(a8::lisp::ValueType::kCProc)) {
abort();
}
func_call_exprs->push_back(cproc);
func_call_exprs->push_back
(std::make_shared<a8::lisp::Value>(a8::lisp::Atom(idx)));
} else {
{
auto cproc = Find("!getSkillNumber");
if (!cproc) {
abort();
}
if (!cproc->IsType(a8::lisp::ValueType::kCProc)) {
abort();
}
func_call_exprs->push_back(cproc);
func_call_exprs->push_back
(std::make_shared<a8::lisp::Value>(a8::lisp::Atom(idx)));
}
}
if (parent_node &&
parent_node->IsType(a8::lisp::ValueType::kList) &&