Skip to content

Commit

Permalink
Merge branch 'master' into vehicle-entity
Browse files Browse the repository at this point in the history
  • Loading branch information
thecraftianman committed Aug 21, 2024
2 parents c038fa1 + e2bb9d8 commit b71f844
Show file tree
Hide file tree
Showing 68 changed files with 1,062 additions and 705 deletions.
16 changes: 16 additions & 0 deletions .glualint.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint_emptyBlocks": true,
"lint_shadowing": false,
"lint_gotos": true,
"lint_goto_identifier": true,
"lint_doubleNegations": true,
"lint_redundantIfStatements": true,
"lint_redundantParentheses": true,
Expand All @@ -17,8 +18,20 @@
"lint_unusedVars": true,
"lint_unusedParameters": true,
"lint_unusedLoopVars": true,
"lint_inconsistentVariableStyle": false,
"lint_spaceBetweenParens": false,
"lint_spaceBetweenBrackets": false,
"lint_spaceBetweenBraces": false,
"lint_ignoreFiles": ["lua/entities/gmod_wire_expression2/core/custom/*.lua"],
"lint_spaceBeforeComma": false,
"lint_spaceAfterComma": true,
"lint_maxLineLength": 0,

"prettyprint_spaceBetweenParens": false,
"prettyprint_spaceBetweenBrackets": false,
"prettyprint_spaceBetweenBraces": false,
"prettyprint_spaceEmptyParens": false,
"prettyprint_spaceEmptyBraces": false,
"prettyprint_spaceAfterParens": false,
"prettyprint_spaceAfterBrackets": false,
"prettyprint_spaceAfterBraces": false,
Expand All @@ -27,6 +40,9 @@
"prettyprint_spaceAfterComma": true,
"prettyprint_semicolons": false,
"prettyprint_cStyle": false,
"prettyprint_removeRedundantParens": true,
"prettyprint_minimizeParens": false,
"prettyprint_assumeOperatorAssociativity": true,
"prettyprint_rejectInvalidCode": false,
"prettyprint_indentation": "\t",
"log_format": "auto"
Expand Down
4 changes: 2 additions & 2 deletions lua/acf/ballistics/ballistics_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function Ballistics.CreateBullet(BulletData)
Bullet.LastThink = Clock.CurTime
Bullet.Fuze = Bullet.Fuze and Bullet.Fuze + Clock.CurTime or nil -- Convert Fuze from fuze length to time of detonation
if Bullet.Caliber then
Bullet.Mask = (Bullet.Caliber < 3 and bit.band(MASK_SOLID,MASK_SHOT) or MASK_SOLID) + CONTENTS_AUX -- I hope CONTENTS_AUX isn't used for anything important? I can't find any references outside of the wiki to it so hopefully I can use this
Bullet.Mask = (Bullet.Caliber < 3 and bit.band(MASK_SOLID, MASK_SHOT) or MASK_SOLID) + CONTENTS_AUX -- I hope CONTENTS_AUX isn't used for anything important? I can't find any references outside of the wiki to it so hopefully I can use this
else
Bullet.Mask = MASK_SOLID + CONTENTS_AUX
end
Expand Down Expand Up @@ -369,7 +369,7 @@ do -- Terminal ballistics --------------------------
function Ballistics.DoRicochet(Bullet, Trace)
local HitAngle = ACF.GetHitAngle(Trace, Bullet.Flight)
local Speed = Bullet.Flight:Length() / ACF.Scale
local MinAngle = math.min(Bullet.Ricochet - Speed / 39.37 / 30 + 20,89.9) -- Making the chance of a ricochet get higher as the speeds increase
local MinAngle = math.min(Bullet.Ricochet - Speed / 39.37 / 30 + 20, 89.9) -- Making the chance of a ricochet get higher as the speeds increase
local Ricochet = 0

if HitAngle < 89.9 and HitAngle > math.random(MinAngle, 90) then -- Checking for ricochet
Expand Down
12 changes: 6 additions & 6 deletions lua/acf/contraption/contraption_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ end
function Contraption.GetAllPhysicalEntities(Ent, Tab)
local Res = Tab or {}

if IsValid(Ent) and not Res[Ent] then
if ACF.Check(Ent) and not Res[Ent] then
Res[Ent] = true

if Ent.Constraints then
Expand All @@ -77,7 +77,7 @@ function Contraption.GetAllChildren(Ent, Tab)
local Res = Tab or {}

for _, V in pairs(Ent:GetChildren()) do
if not IsValid(V) or Res[V] then continue end
if not ACF.Check(V) or Res[V] then continue end

Res[V] = true
Contraption.GetAllChildren(V, Res)
Expand All @@ -87,7 +87,7 @@ function Contraption.GetAllChildren(Ent, Tab)
end

function Contraption.GetEnts(Ent)
local Ancestor = Contraption.GetAncestor(Ent)
local Ancestor = Ent:GetAncestor()
local Phys = Contraption.GetAllPhysicalEntities(Ancestor)
local Pare = {}

Expand Down Expand Up @@ -256,8 +256,8 @@ do -- ASSUMING DIRECT CONTROL
if Trace.Entity.IsACFEntity then return false end
end)

hook.Add("Initialize", "ACF Meta Detour",function()
timer.Simple(1,function()
hook.Add("Initialize", "ACF Meta Detour", function()
timer.Simple(1, function()
Contraption.Detours = Contraption.Detours or {
ENT = {},
OBJ = {},
Expand Down Expand Up @@ -355,7 +355,7 @@ do -- ASSUMING DIRECT CONTROL
SetNotSolid(self, ...)
end

hook.Remove("Initialize","ACF Meta Detour")
hook.Remove("Initialize", "ACF Meta Detour")
end)
end)
end
4 changes: 2 additions & 2 deletions lua/acf/contraption/overrides_cl.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
hook.Add("OnEntityCreated", "ACF Stub Exploitables",function(Entity)
timer.Simple(1,function()
hook.Add("OnEntityCreated", "ACF Stub Exploitables", function(Entity)
timer.Simple(1, function()
if not IsValid(Entity) then return end
if not Entity.IsACFEntity then return end

Expand Down
2 changes: 1 addition & 1 deletion lua/acf/core/classes/turrets/registration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function Turrets.Register(ID, Data)
local Group = Classes.AddGroup(ID, Entries, Data)

if not Group.LimitConVar then
print("Added LimitConVar for ",ID)
print("Added LimitConVar for ", ID)
Group.LimitConVar = {
Name = "_acf_turret",
Amount = 24,
Expand Down
2 changes: 1 addition & 1 deletion lua/acf/core/globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ do -- ACF global vars
ACF.FuelFactor = 1 -- Multiplier for ACF.FuelRate
ACF.FuelMinSize = 6 -- Defines the shortest possible length of fuel tanks for all their axises, in gmu
ACF.FuelMaxSize = 96 -- Defines the highest possible length of fuel tanks for all their axises, in gmu
ACF.FuelArmor = 5 -- How many millimeters of armor fuel tanks have
ACF.FuelArmor = 1 -- How many millimeters of armor fuel tanks have
ACF.FuelRefillColor = Color(76, 201, 250, 10) -- The color to use for the fuel refill effect
ACF.TankVolumeMul = 1 -- Multiplier for fuel tank capacity, 1.0 is approx real world
ACF.LiIonED = 0.458 -- li-ion energy density: kw hours / liter
Expand Down
12 changes: 11 additions & 1 deletion lua/acf/core/utilities/messages/messages_cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ function Messages.PrintChat(Type, ...)
local Data = Messages.GetType(Type)
local Prefix = "[ACF" .. Data.Prefix .. "] "
local Message = istable(...) and ... or { ... }
local Strings = string.Split(table.concat(Message), " ")

chat.AddText(Data.Color, Prefix, color_white, table.concat(Message))
-- This is needed to properly make sure that localized strings are translated...because nothing is allowed to be easy in this game...
for Key, String in ipairs(Strings) do
if string.StartsWith(String, "#") then
Strings[Key] = language.GetPhrase(String)
else
Strings[Key] = String .. " "
end
end

chat.AddText(Data.Color, Prefix, color_white, table.concat(Strings))
end

net.Receive("ACF_Messages", function()
Expand Down
Loading

0 comments on commit b71f844

Please sign in to comment.