GE Lua Documentation

Press F to search!

startCrawlFlowgraph

Definition


-- @/lua/ge/extensions/gameplay/crawl/general.lua:122

local function startCrawlFlowgraph(trail, veh)
  if not trail or not veh then
    log('E', logTag, 'Cannot start crawl: no valid trail data')
    return false
  end

  if M.activeTrail and M.activeTrail.trail and M.activeTrail.trail.name == trail.name then
    local crawlerData = crawlersData[1]
    if not crawlerData then
      crawlerData = gameplay_crawl_utils.setupCrawlerData(veh)
      table.insert(crawlersData, crawlerData)
    end

    if gameplay_crawl_utils.startCrawl(veh:getID(), trail, crawlerData, true) then
      extensions.hook('onCrawlStarted')
      return true
    else
      return false
    end
  end

  if not setupCrawl(trail, veh, true) then
    log('E', logTag, 'Failed to setup crawl')
    return false
  end

  local crawlerData = crawlersData[1]
  if not crawlerData then
    log('E', logTag, 'No crawler data found after setup')
    return false
  end

  if gameplay_crawl_utils.startCrawl(veh:getID(), trail, crawlerData, true) then
    extensions.hook('onCrawlStarted')
    return true
  else
    return false
  end
end

Callers

@/lua/ge/extensions/gameplay/crawl/flowgraphBridge.lua

  if gameplay_crawl_general.startCrawlFlowgraph(trail, veh) then
    return true