Guest User

entry.lua hotfix

a guest
Mar 24th, 2025
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 24.91 KB | Source Code | 0 0
  1. local pipe = require "entry/pipe"
  2. local func = require "entry/func"
  3. local coor = require "entry/coor"
  4. -- local dump = require "luadump"
  5.  
  6. --"Steam\steamapps\workshop\content\1066780\1924671230\res\config\game_script\entry.lua"
  7. --Transport Fever 2 Underpass mod, entry.lua by Enzoz
  8. --Lua error crash on start after loading game hotfix by Nero1024
  9. --Long-term stability unknown, this is just to let the map load
  10. local state = {
  11.     warningShaderMod = false,
  12.    
  13.     items = {},
  14.     addedItems = {},
  15.     checkedItems = {},
  16.    
  17.     stations = {},
  18.     entries = {},
  19.    
  20.     windows = {
  21.         window = false,
  22.         desc = false,
  23.         icon = false,
  24.         button = false,
  25.         list = false
  26.     },
  27.     built = {},
  28.     builtLevelCount = {},
  29.    
  30.     fn = {}
  31. }
  32.  
  33. local cov = function(m)
  34.     return func.seqMap({0, 3}, function(r)
  35.         return func.seqMap({1, 4}, function(c)
  36.             return m[r * 4 + c]
  37.         end)
  38.     end)
  39. end
  40.  
  41. local pure = function(pa)
  42.     local params = {}
  43.     for key, value in pairs(pa) do
  44.         if (key ~= "seed" and key ~= "modules") then
  45.             params[key] = value
  46.         end
  47.     end
  48.     return params
  49. end
  50.  
  51. local decomp = function(params, transf)
  52.     local group = {}
  53.     for slotId, m in pairs(params.modules) do
  54.         local groupId = (slotId - slotId % 10000) / 10000 % 10
  55.         if not group[groupId] then
  56.             group[groupId] = {
  57.                 modules = {},
  58.                 params = m.params,
  59.                 transf = m.transf or transf
  60.             }
  61.         end
  62.         group[groupId].modules[slotId - groupId * 10000] = m
  63.     end
  64.     return group
  65. end
  66.  
  67. local removeEntry = function(id)
  68.     if (state.windows.window) then
  69.         local comp = api.gui.util.getById(("underpass.entities.%d"):format(id))
  70.         if comp then
  71.             state.windows.list:removeItem(comp)
  72.             comp:destroy()
  73.         end
  74.         state.addedItems = func.filter(state.addedItems, function(e) return e ~= id end)
  75.         state.checkedItems = func.filter(state.checkedItems, function(e) return e ~= id end)
  76.     end
  77. end
  78.  
  79. local addEntry = function(id)
  80.     if (state.windows.window) then
  81.         local entity = game.interface.getEntity(id)
  82.         if (entity) then
  83.             local isEntry = func.contains(state.entries, id)
  84.             local isStation = func.contains(state.stations, id)
  85.             local isBuilt = isStation and entity.params and entity.params.isFinalized == 1
  86.             if (isEntry or isStation) then
  87.                 local check = api.gui.comp.CheckBox.new(
  88.                     "",
  89.                     "ui/design/components/checkbox_invalid.tga",
  90.                     "ui/design/components/checkbox_valid.tga"
  91.                 )
  92.                                 --load crash was caused by entity.name being nil for some reason
  93.                                 --likely from the undergorund station the UI wizard is referencing being missing/deleted
  94.                                 if entity.name == nil then entity.name = "NIL (something is broken!)" end -- workaround, stability unkown
  95.                 local lable = api.gui.comp.TextView.new(isEntry and tostring(id) or entity.name .. (isBuilt and _("BUILT") or ""))
  96.                
  97.                 local icon = api.gui.comp.ImageView.new(
  98.                     isEntry and
  99.                     "ui/construction/street/underpass_entry_small.tga" or
  100.                     "ui/construction/station/rail/mus_small.tga"
  101.                 )
  102.                 local locateView = api.gui.comp.ImageView.new("ui/design/window-content/locate_small.tga")
  103.                 local locateBtn = api.gui.comp.Button.new(locateView, true)
  104.                
  105.                 check:setGravity(0, 0.5)
  106.                 locateBtn:setGravity(0, 0.5)
  107.                 icon:setGravity(0, 0.5)
  108.                 lable:setGravity(-1, 0.5)
  109.                
  110.                 local layout = api.gui.layout.BoxLayout.new("HORIZONTAL")
  111.                 local comp = api.gui.comp.Component.new("")
  112.                 comp:setLayout(layout)
  113.                
  114.                 check:setId(("underpass.check.%d"):format(id))
  115.                 comp:setId(("underpass.entities.%d"):format(id))
  116.                
  117.                 layout:addItem(locateBtn)
  118.                 layout:addItem(check)
  119.                 layout:addItem(icon)
  120.                 layout:addItem(lable)
  121.                
  122.                 locateBtn:onClick(function()
  123.                     local pos = entity.position
  124.                     game.gui.setCamera({pos[1], pos[2], pos[3], -4.77, 0.2})
  125.                 end)
  126.                
  127.                 check:onToggle(
  128.                     function()
  129.                         if (func.contains(state.checkedItems, id)) then
  130.                             table.insert(state.fn, function()game.interface.sendScriptEvent("__underpassEvent__", "uncheck", {id = id}) end)
  131.                         else
  132.                             table.insert(state.fn, function()game.interface.sendScriptEvent("__underpassEvent__", "check", {id = id}) end)
  133.                         end
  134.                     end
  135.                 )
  136.                 state.windows.list:addItem(comp)
  137.                 state.addedItems[#state.addedItems + 1] = id
  138.             end
  139.         end
  140.     end
  141. end
  142.  
  143. local createWindow = function()
  144.     if (not state.windows.window and #state.items > 0) then
  145.         local finishIcon = api.gui.comp.ImageView.new("ui/construction/street/underpass_entry_op.tga")
  146.         local finishButton = api.gui.comp.Button.new(finishIcon, true)
  147.         local desc = api.gui.comp.TextView.new("")
  148.         local hLayout = api.gui.layout.BoxLayout.new("HORIZONTAL")
  149.        
  150.         hLayout:addItem(finishButton)
  151.         hLayout:addItem(desc)
  152.        
  153.         local hcomp = api.gui.comp.Component.new("")
  154.         hcomp:setLayout(hLayout)
  155.        
  156.         local vLayout = api.gui.layout.BoxLayout.new("VERTICAL")
  157.         local wcomp = api.gui.comp.Component.new("")
  158.         wcomp:setLayout(vLayout)
  159.        
  160.         state.windows.window = api.gui.comp.Window.new("", wcomp)
  161.         state.windows.window:setId("underpass.window")
  162.        
  163.         vLayout:addItem(hcomp)
  164.        
  165.         state.windows.window:onClose(function()
  166.             state.windows.window:setVisible(false, false)
  167.             table.insert(state.fn, function()
  168.                 game.interface.sendScriptEvent("__underpassEvent__", "window.close", {})
  169.             end)
  170.         end)
  171.        
  172.         finishButton:onClick(function()
  173.             if (state.windows.window) then
  174.                 table.insert(state.fn, function()
  175.                     game.interface.sendScriptEvent("__underpassEvent__", "construction", {})
  176.                 end)
  177.             end
  178.         end)
  179.        
  180.         state.windows.button = finishButton
  181.         state.windows.icon = finishIcon
  182.         state.windows.desc = desc
  183.         state.windows.list = vLayout
  184.        
  185.         game.gui.window_setPosition("underpass.window", 200, 200)
  186.     end
  187. end
  188.  
  189. local showWindow = function()
  190.     if state.windows.window and #state.items > 0 then
  191.         state.windows.window:setVisible(true, false)
  192.     elseif not state.windows.window and #state.items > 0 then
  193.         createWindow()
  194.     end
  195. end
  196.  
  197. local checkFn = function()
  198.     if (state.windows.window) then
  199.         local stations = func.filter(state.checkedItems, function(e) return func.contains(state.stations, e) end)
  200.         local entries = func.filter(state.checkedItems, function(e) return func.contains(state.entries, e) end)
  201.         local built = func.filter(state.checkedItems, function(e) return func.contains(state.built, e) end)
  202.        
  203.         if (#stations > 0) then
  204.             if (#stations - #built + func.fold(built, 0, function(t, b) return (state.builtLevelCount[b] or 99) + t end) > 8) then
  205.                 state.windows.button:setEnabled(false)
  206.                 state.windows.desc:setText(_("STATION_MAX_LIMIT"))
  207.             elseif (#entries > 0 or (#built > 0 and #stations > 1)) then
  208.                 state.windows.button:setEnabled(true)
  209.                 state.windows.desc:setText(_("STATION_CAN_FINALIZE"))
  210.             else
  211.                 state.windows.button:setEnabled(false)
  212.                 state.windows.desc:setText(_("STATION_NEED_ENTRY"))
  213.             end
  214.             state.windows.icon:setImage("ui/construction/station/rail/mus_op.tga", false)
  215.             state.windows.window:setTitle(_("STATION_CON"))
  216.         elseif (#stations == 0) then
  217.             if (#entries > 1) then
  218.                 state.windows.button:setEnabled(true)
  219.                 state.windows.desc:setText(_("UNDERPASS_CAN_FINALIZE"))
  220.             else
  221.                 state.windows.button:setEnabled(false)
  222.                 state.windows.desc:setText(_("UNDERPASS_NEED_ENTRY"))
  223.             end
  224.             state.windows.icon:setImage("ui/construction/street/underpass_entry_op.tga", false)
  225.             state.windows.window:setTitle(_("UNDERPASS_CON"))
  226.         else
  227.             state.windows.button:setEnabled(false)
  228.         end
  229.        
  230.         if #state.items == 0 then
  231.             state.windows.window:setVisible(false, false)
  232.         end
  233.     end
  234. end
  235.  
  236. local shaderWarning = function()
  237.     if (not game.config.shaderMod) then
  238.         if not state.warningShaderMod then
  239.             local textview = gui.textView_create(
  240.                 "underpass.warning.textView",
  241.                 _([["SHADER_WARNING"]]),
  242.                 400
  243.             )
  244.             local layout = gui.boxLayout_create("underpass.warning.boxLayout", "VERTICAL")
  245.             layout:addItem(textview)
  246.             state.warningShaderMod = gui.window_create(
  247.                 "underpass.warning.window",
  248.                 _("Warning"),
  249.                 layout
  250.             )
  251.             state.warningShaderMod:onClose(function()state.warningShaderMod = false end)
  252.         end
  253.        
  254.         local mainView = game.gui.getContentRect("mainView")
  255.         local mainMenuHeight = game.gui.getContentRect("mainMenuTopBar")[4] + game.gui.getContentRect("mainMenuBottomBar")[4]
  256.         local size = game.gui.calcMinimumSize(state.warningShaderMod.id)
  257.         local y = mainView[4] - size[2] - mainMenuHeight
  258.         local x = mainView[3] - size[1]
  259.        
  260.         game.gui.window_setPosition(state.warningShaderMod.id, x * 0.5, y * 0.5)
  261.         game.gui.setHighlighted(state.warningShaderMod.id, true)
  262.     end
  263. end
  264.  
  265. local buildStation = function(entries, stations, built)
  266.     local ref = built and #built > 0 and built[1] or stations[1]
  267.     local vecRef, rotRef, _ = coor.decomposite(ref.transf)
  268.     local iRot = coor.inv(cov(rotRef))
  269.    
  270.     local groups = {}
  271.     local entry = {}
  272.    
  273.     if (built and #built > 0) then
  274.         for _, b in ipairs(built) do
  275.             local group = decomp(b.params, b.transf)
  276.             for gId, g in pairs(group) do
  277.                 if (gId == 9) then
  278.                     for _, m in ipairs(g.modules) do
  279.                         m.transf = coor.I() * m.transf * b.transf
  280.                         table.insert(entry, m)
  281.                     end
  282.                 else
  283.                     g.transf = coor.I() * g.transf * b.transf
  284.                     table.insert(groups, g)
  285.                 end
  286.             end
  287.         end
  288.     end
  289.    
  290.     for _, e in ipairs(stations) do
  291.         table.insert(groups, {
  292.             modules = e.params.modules,
  293.             params = func.with(pure(e.params), {isFinalized = 1}),
  294.             transf = e.transf
  295.         })
  296.     end
  297.    
  298.     for _, e in ipairs(entries) do
  299.         local g = {
  300.             metadata = {entry = true},
  301.             name = e.params.modules[1].name,
  302.             variant = 0,
  303.             transf = e.transf,
  304.             params = func.with(pure(e.params), {isStation = true})
  305.         }
  306.         table.insert(entry, g)
  307.     end
  308.    
  309.     local modules = {}
  310.     for i, g in ipairs(groups) do
  311.         local vec, rot, _ = coor.decomposite(g.transf)
  312.         local transf = iRot * rot * coor.trans((vec - vecRef) .. iRot)
  313.         for slotId, m in pairs(g.modules) do
  314.             m.params = g.params
  315.             m.transf = transf
  316.             modules[slotId + i * 10000] = m
  317.         end
  318.     end
  319.    
  320.     for i, e in ipairs(entry) do
  321.         local vec, rot, _ = coor.decomposite(e.transf)
  322.         e.transf = iRot * rot * coor.trans((vec - vecRef) .. iRot)
  323.         modules[90000 + i] = e
  324.     end
  325.    
  326.     if (built and #built > 1) then local _ = built * pipe.range(2, #built) * pipe.map(pipe.select("id")) * pipe.forEach(game.interface.bulldoze) end
  327.     local _ = stations * (built and pipe.noop() or pipe.range(2, #stations)) * pipe.map(pipe.select("id")) * pipe.forEach(game.interface.bulldoze)
  328.     local _ = entries * pipe.map(pipe.select("id")) * pipe.forEach(game.interface.bulldoze)
  329.    
  330.     local newId = game.interface.upgradeConstruction(
  331.         ref.id,
  332.         "station/rail/mus.con",
  333.         func.with(
  334.             pure(ref.params),
  335.             {
  336.                 modules = modules,
  337.                 isFinalized = 1
  338.             })
  339.     )
  340.     if newId then
  341.         if (built and #built > 1) then
  342.             for _, b in ipairs(built) do
  343.                 state.builtLevelCount[b.id] = nil
  344.             end
  345.         end
  346.         state.builtLevelCount[newId] = #groups
  347.         state.items = func.filter(state.items, function(e) return not func.contains(state.checkedItems, e) end)
  348.         state.checkedItems = {}
  349.         state.stations = func.filter(state.stations, function(e) return func.contains(state.items, e) end)
  350.         state.entries = func.filter(state.entries, function(e) return func.contains(state.items, e) end)
  351.         state.built = func.filter(state.built, function(e) return func.contains(state.items, e) end)
  352.     end
  353. end
  354.  
  355. local buildUnderpass = function(entries)
  356.     local ref = entries[1]
  357.     local vecRef, rotRef, _ = coor.decomposite(ref.transf)
  358.     local iRot = coor.inv(cov(rotRef))
  359.     local _ = entries * pipe.range(2, #entries) * pipe.map(pipe.select("id")) * pipe.forEach(game.interface.bulldoze)
  360.     local newId = game.interface.upgradeConstruction(
  361.         ref.id,
  362.         ref.fileName,
  363.         func.with(
  364.             pure(ref.params),
  365.             {
  366.                 modules = func.map(entries,
  367.                     function(entry)
  368.                         local vec, rot, _ = coor.decomposite(entry.transf)
  369.                         return {
  370.                             metadata = {entry = true},
  371.                             name = entry.params.modules[1].name,
  372.                             variant = 0,
  373.                             transf = iRot * rot * coor.trans((vec - vecRef) .. iRot),
  374.                             params = pure(entry.params)
  375.                         }
  376.                     end)
  377.             }))
  378.     if newId then
  379.         state.items = func.filter(state.items, function(e) return not func.contains(state.checkedItems, e) end)
  380.         state.entries = func.filter(state.entries, function(e) return func.contains(state.items, e) end)
  381.         state.checkedItems = {}
  382.     end
  383. end
  384.  
  385. local script = {
  386.     save = function()
  387.         if not state then state = {} end
  388.         if not state.items then state.items = {} end
  389.         if not state.checkedItems then state.checkedItems = {} end
  390.         if not state.stations then state.stations = {} end
  391.         if not state.entries then state.entries = {} end
  392.         if not state.built then state.built = {} end
  393.         if not state.builtLevelCount then state.builtLevelCount = {} end
  394.        
  395.         return state
  396.     end,
  397.     load = function(data)
  398.         if data then
  399.             state.items = data.items or {}
  400.             state.checkedItems = data.checkedItems or {}
  401.             state.stations = data.stations or {}
  402.             state.entries = data.entries or {}
  403.             state.builtLevelCount = data.builtLevelCount or {}
  404.             state.built = data.built or {}
  405.         end
  406.     end,
  407.     guiUpdate = function()
  408.         for _, f in ipairs(state.fn) do f() end
  409.         state.fn = {}
  410.        
  411.         if #state.addedItems < #state.items then
  412.             showWindow()
  413.         end
  414.        
  415.         if state.windows.window then
  416.             if (#state.addedItems < #state.items) then
  417.                 for i = #state.addedItems + 1, #state.items do
  418.                     addEntry(state.items[i])
  419.                 end
  420.             elseif (#state.addedItems > #state.items) then
  421.                 local remove = func.filter(state.addedItems, function(i) return not func.contains(state.items, i) end)
  422.                 for _, id in ipairs(remove) do
  423.                     removeEntry(id)
  424.                 end
  425.             else
  426.                 local check = {}
  427.                 for _, id in ipairs(state.items) do
  428.                     check[id] = false
  429.                 end
  430.                 for _, id in ipairs(state.checkedItems) do
  431.                     check[id] = true
  432.                 end
  433.                 for id, c in pairs(check) do
  434.                     local check = api.gui.util.getById(("underpass.check.%d"):format(id))
  435.                     check:setSelected(c, false)
  436.                 end
  437.             end
  438.             checkFn()
  439.         end
  440.     end,
  441.     handleEvent = function(src, id, name, param)
  442.         if (id == "__underpassEvent__") then
  443.             if (name == "remove") then
  444.                 state.items = func.filter(state.items, function(e) return not func.contains(param, e) end)
  445.                 state.checkedItems = func.filter(state.checkedItems, function(e) return not func.contains(param, e) end)
  446.                 state.entries = func.filter(state.entries, function(e) return not func.contains(param, e) end)
  447.                 state.stations = func.filter(state.stations, function(e) return not func.contains(param, e) end)
  448.                 state.built = func.filter(state.built, function(e) return not func.contains(param, e) end)
  449.             elseif (name == "new") then
  450.                 state.items[#state.items + 1] = param.id
  451.                 state.checkedItems[#state.checkedItems + 1] = param.id
  452.                 if (param.isEntry) then state.entries[#state.entries + 1] = param.id
  453.                 elseif (param.isStation) then state.stations[#state.stations + 1] = param.id end
  454.             elseif (name == "uncheck") then
  455.                 state.checkedItems = func.filter(state.checkedItems, function(e) return e ~= param.id end)
  456.             elseif (name == "check") then
  457.                 if (not func.contains(state.checkedItems, param.id)) then
  458.                     state.checkedItems[#state.checkedItems + 1] = param.id
  459.                 end
  460.             elseif (name == "construction") then
  461.                 local entries = pipe.new
  462.                     * state.checkedItems
  463.                     * pipe.filter(function(e) return func.contains(state.entries, e) end)
  464.                     * pipe.map(game.interface.getEntity)
  465.                     * pipe.filter(pipe.noop())
  466.                
  467.                 entries =
  468.                     entries * pipe.filter(function(e) return e.fileName == "street/underpass_entry.con" end) +
  469.                     entries * pipe.filter(function(e) return e.fileName ~= "street/underpass_entry.con" end)
  470.                
  471.                 local built = pipe.new
  472.                     * state.checkedItems
  473.                     * pipe.filter(function(e) return func.contains(state.built, e) end)
  474.                     * pipe.map(game.interface.getEntity)
  475.                     * pipe.filter(pipe.noop())
  476.                
  477.                 local stations = pipe.new
  478.                     * state.checkedItems
  479.                     * pipe.filter(function(e) return func.contains(state.stations, e) and not func.contains(state.built, e) end)
  480.                     * pipe.map(game.interface.getEntity)
  481.                     * pipe.filter(pipe.noop())
  482.                
  483.                 if (#built > 0 and (#entries + #stations) > 0) then
  484.                     buildStation(entries, stations, built)
  485.                 elseif (#built > 1) then
  486.                     buildStation(entries, stations, built)
  487.                 elseif (#stations == 0 and #entries > 1) then
  488.                     buildUnderpass(entries)
  489.                 elseif (#stations > 0 and #entries > 0) then
  490.                     buildStation(entries, stations)
  491.                 end
  492.             elseif (name == "select") then
  493.                 if not func.contains(state.built, param.id) then
  494.                     state.items[#state.items + 1] = param.id
  495.                     state.stations[#state.stations + 1] = param.id
  496.                     state.built[#state.built + 1] = param.id
  497.                     state.builtLevelCount[param.id] = param.nbGroup
  498.                 end
  499.             elseif (name == "window.close") then
  500.                 state.items = func.filter(state.items, function(i) return not func.contains(state.built, i) or func.contains(state.checkedItems, i) end)
  501.                 state.built = func.filter(state.built, function(b) return func.contains(state.checkedItems, b) end)
  502.             end
  503.         end
  504.     end,
  505.     guiHandleEvent = function(id, name, param)
  506.         if id == "mainView" and name == "select" then
  507.             local entity = game.interface.getEntity(param)
  508.             if (entity and entity.type == "CONSTRUCTION" and entity.fileName == "street/underpass_entry.con") then
  509.                 if func.contains(state.items, entity.id) then
  510.                     showWindow()
  511.                 end
  512.             elseif (entity and entity.type == "STATION_GROUP") then
  513.                 local lastVisited = false
  514.                 local nbGroup = 0
  515.                 local map = api.engine.system.streetConnectorSystem.getStation2ConstructionMap()
  516.                 for _, id in ipairs(api.engine.getComponent(param, api.type.ComponentType.STATION_GROUP).stations) do
  517.                     local conId = map[id]
  518.                     if conId then
  519.                         local con = api.engine.getComponent(conId, api.type.ComponentType.CONSTRUCTION)
  520.                         if (con.fileName == "station/rail/mus.con" and con.params.isFinalized and con.params.isFinalized == 1) then
  521.                             lastVisited = conId
  522.                             nbGroup = #(func.filter(func.keys(decomp(con.params)), function(g) return g < 9 end))
  523.                         elseif func.contains(state.items, conId) then
  524.                             showWindow()
  525.                         end
  526.                     end
  527.                 end
  528.                
  529.                 if lastVisited then
  530.                     if not api.gui.util.getById("mus.config." .. param) then
  531.                         local w = api.gui.util.getById("temp.view.entity_" .. param)
  532.                         local layout = w:getLayout()
  533.                         local subWindow = layout:getItem(1)
  534.                         local subLayout = subWindow:getLayout():getItem(0)
  535.                         local buttonText = api.gui.comp.TextView.new(_("UNDERGROUND_EXTEND"))
  536.                         local buttonImage = api.gui.comp.ImageView.new("ui/icons/game-menu/configure.tga")
  537.                         local buttonLayout = api.gui.layout.BoxLayout.new("HORIZONTAL")
  538.                         local buttonComp = api.gui.comp.Component.new("")
  539.                         buttonLayout:addItem(buttonImage)
  540.                         buttonLayout:addItem(buttonText)
  541.                         buttonComp:setLayout(buttonLayout)
  542.                         local button = api.gui.comp.Button.new(buttonComp, true)
  543.                         buttonText:setName("ConfigureButton::Text")
  544.                         button:setName("ConfigureButton")
  545.                         button:setId("mus.config." .. param)
  546.                        
  547.                         subLayout:addItem(button)
  548.  
  549.                         button:onClick(function()
  550.                             table.insert(state.fn, function()
  551.                             game.interface.sendScriptEvent("__underpassEvent__", "select", {id = lastVisited, nbGroup = nbGroup})
  552.                             end)
  553.                         end)
  554.                     end
  555.                 end
  556.             end
  557.         end
  558.         if name == "builder.apply" then
  559.             local toRemove = param.proposal.toRemove
  560.             local toAdd = param.proposal.toAdd
  561.             if not (toRemove and #toRemove == 1 and toAdd and #toAdd == 1 and toRemove[1] == param.result[1]) then
  562.                 if toRemove then
  563.                     local params = {}
  564.                     for _, r in ipairs(toRemove) do if func.contains(state.items, r) then params[#params + 1] = r end end
  565.                     if (#params > 0) then
  566.                         game.interface.sendScriptEvent("__underpassEvent__", "remove", params)
  567.                     end
  568.                 end
  569.                 if toAdd and #toAdd > 0 then
  570.                     for i = 1, #toAdd do
  571.                         local con = toAdd[i]
  572.                         if (con.fileName == [[street/underpass_entry.con]]) then
  573.                             shaderWarning()
  574.                             game.interface.sendScriptEvent("__underpassEvent__", "new", {id = param.result[1], isEntry = true})
  575.                         end
  576.                     end
  577.                 end
  578.             end
  579.         end
  580.     end
  581. }
  582.  
  583. function data()
  584.     return script
  585. end
  586.  
Advertisement
Add Comment
Please, Sign In to add comment