breakBreakGroup
Definition
-- @/lua/vehicle/beamstate.lua:166
local function breakBreakGroup(g)
if g == nil then
return
end
brokenBreakGroups[g] = true
-- hide props if they use
props.hidePropsInBreakGroup(g)
-- break all beams in that group
local bg = breakGroupCache[g]
if bg then
breakGroupCache[g] = nil
for _, bcid in ipairs(bg) do
obj:breakBeam(bcid)
luaBreakBeam(bcid)
end
end
-- break all couplers
bg = couplerBreakGroupCache[g]
if bg then
couplerBreakGroupCache[g] = nil
for _, ccid in ipairs(bg) do
obj:detachCoupler(ccid, math.huge)
end
end
--break triangle breakgroups matching the beam breakgroup
bg = triangleBreakGroupCache[g]
if bg then
for _, ctid in ipairs(bg) do
obj:breakCollisionTriangle(ctid)
collTriState[ctid] = nil
end
triangleBreakGroupCache[g] = nil
end
end
Callers
@/lua/vehicle/beamstate.lua
for _, g in pairs(breakGroups) do
breakBreakGroup(g)
end
if torsionbar.breakGroupType == 0 or torsionbar.breakGroupType == nil then
breakBreakGroup(g)
end
if beam.breakGroupType == 0 or beam.breakGroupType == nil then
breakBreakGroup(g)
end
for breakgroup, _ in pairs(couplerBreakGroupCache) do
breakBreakGroup(breakgroup)
end
if type(breakgroup) == "string" and (string.find(breakgroup, "hinge") ~= nil or string.find(breakgroup, "latch") ~= nil) then
breakBreakGroup(breakgroup)
end
@/lua/ge/extensions/scenario/scenariohelper.lua
--breaks a single break group in a vehicle
local function breakBreakGroup(vehicleName, group)
queueLuaCommand(getVehicleByName(vehicleName), 'beamstate.breakBreakGroup("'..group..'")')
local function breakBreakGroup(vehicleName, group)
queueLuaCommand(getVehicleByName(vehicleName), 'beamstate.breakBreakGroup("'..group..'")')
end
@/lua/vehicle/controller/pyrotechnicCharge.lua
for _, breakgroup in ipairs(breakgroups) do
beamstate.breakBreakGroup(breakgroup)
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/beamstate/breakgroup.lua
for _,g in pairs(groups) do
veh:queueLuaCommand("beamstate.breakBreakGroup('" .. g .. "')")
end