Skip to content

Commit

Permalink
Fix Linter Issues and Typos
Browse files Browse the repository at this point in the history
  • Loading branch information
LengthenedGradient committed Apr 7, 2024
1 parent b709965 commit 6908ae6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions lua/acf/core/utilities/util_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ do
end
end

-- Similar to constraint.RemoveAll
local function ClearConstraints(Entity)
local Constraints = Entity.Constraints

Expand Down Expand Up @@ -297,7 +298,7 @@ do -- Entity linking
---@param Entity table The entity to check
---@param VarName string The field of the entity that stores link sources (e.g. "Entity.FuelTanks" for engines)
---@param SingleEntry boolean | nil Whether the entity supports a single source link or multiple
---@return table<table, true> # A table whos keys are the link source entities and whos values are all true
---@return table<table, true> # A table whose keys are the link source entities and whose values are all true
---@see EntityLink
local function GetEntityLinks(Entity, VarName, SingleEntry)
if not Entity[VarName] then return {} end
Expand Down Expand Up @@ -355,7 +356,7 @@ do -- Entity linking
return Result
end

-- Returns the link source callable of a given class and VarName
---Returns the link source callable of a given class and VarName
---@param Class string The name of the class
---@param VarName string The varname for the given class
---@return fun(Entity:table):table # The link source callable
Expand All @@ -365,7 +366,9 @@ do -- Entity linking
return EntityLink[Class][VarName]
end

-- Returns a table of entities linked to the given entity.
---Returns a table of entities linked to the given entity.
---@param Entity The entity to get links from
---@return table<table,true> # A table mapping entities to true.
function ACF.GetLinkedEntities(Entity)
if not IsValid(Entity) then return {} end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ local function GetLinkedWheels(Target)

Queued[Current] = nil
Checked[Current] = true

for Name, Action in pairs(Sources) do -- For all source types
for Entity in pairs(Action(Current)) do -- For all entities of this source type
if not (Checked[Entity] or Queued[Entity]) then
if not (Checked[Entity] or Queued[Entity]) then
if Name == "Wheels" then
Checked[Entity] = true
Linked[Entity] = true
Expand Down

0 comments on commit 6908ae6

Please sign in to comment.