Skip to content

Breaking change in 3.0-rc6 with multiple returned results from call #221

@AnyPioneer

Description

@AnyPioneer
int NodeWithLua::hook_goto() {
  auto hook = "hook_goto";
  luabridge::LuaRef table = luabridge::getGlobal(L, _tableName);

  auto F = table[hook];
  if (!F.isFunction()) {
    // auto s = std::format("{} {} is not a function!", _functionName, hook);
    // std::cerr << s << std::endl;
    // throw std::runtime_error(s);
    return 0;
  }

  auto over = F();
  if (over.hasFailed()) {
    std::cerr << over.errorMessage();
    throw std::runtime_error(over.errorMessage());
  }

  if (over.size() > 0) {
    auto gotoNodeId = over[0].cast<int>().valueOr(0);
    return gotoNodeId;
  }

  return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions