Skip to content

Commit 3a92e1e

Browse files
Merge branch 'master' into hook-docs
2 parents a058f4e + c97753d commit 3a92e1e

File tree

8 files changed

+60
-60
lines changed

8 files changed

+60
-60
lines changed

lua/acf/entities/racks/racks.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Racks.Register("4x AGM-114", {
140140

141141
MountPoints = {
142142
{ Name = "missile1", Position = Vector(0, -7.85, 4.9), Direction = Vector(0, 0, -1) },
143-
{ Name = "missile2", Position = Vector(0, 8.05,4.9), Direction = Vector(0, 0, -1) },
143+
{ Name = "missile2", Position = Vector(0, 8.05, 4.9), Direction = Vector(0, 0, -1) },
144144
{ Name = "missile3", Position = Vector(0, -7.85, -13), Direction = Vector(0, 0, -1) },
145145
{ Name = "missile4", Position = Vector(0, 8.05, -13), Direction = Vector(0, 0, -1) }
146146
}

lua/acf/entities/sensors/receivers/receivers.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ do -- Laser Receiver
1919

2020
local ReceiverOrigin = Receiver:LocalToWorld(Receiver.Origin)
2121

22-
for k,v in pairs(ACF.ActiveLasers) do
22+
for k, v in pairs(ACF.ActiveLasers) do
2323
local Dir = k.Dir or k:GetForward()
2424
if v.Distance > 0 then Dir = (v.HitPos - v.Origin):GetNormalized() end
2525

2626
if Dir:Dot((ReceiverOrigin - v.Origin):GetNormalized()) >= Receiver.Cone then Lasers[k] = true end
2727
end
2828

2929
-- Wiremod laser pointer, because it's, you know, a laser
30-
for _,ply in pairs(player.GetAll()) do
30+
for _, ply in ipairs(player.GetAll()) do
3131
local Wep = ply:GetWeapon("laserpointer")
3232
if not IsValid(Wep) then continue end
3333
if Wep ~= ply:GetActiveWeapon() then continue end
3434

3535
if Wep.Pointing then
36-
local Las = {Dir = ply:EyeAngles():Forward(),Position = ply:EyePos(),Player = ply}
36+
local Las = {Dir = ply:EyeAngles():Forward(), Position = ply:EyePos(), Player = ply}
3737

3838
if Las.Dir:Dot((ReceiverOrigin - Las.Position):GetNormalized()) >= Receiver.Cone then Lasers[Las] = true end
3939
end
@@ -47,8 +47,8 @@ do -- Laser Receiver
4747
TraceData.start = Start
4848
TraceData.endpos = End
4949
if IsValid(Source.Player) then
50-
TraceData.filter = {Receiver,Source.Player}
51-
else TraceData.filter = {Receiver,Source} end
50+
TraceData.filter = {Receiver, Source.Player}
51+
else TraceData.filter = {Receiver, Source} end
5252

5353
return not TraceLine(TraceData).Hit
5454
end
@@ -61,7 +61,7 @@ do -- Laser Receiver
6161
Mass = 25,
6262
Health = 10,
6363
Armor = 10,
64-
Offset = Vector(0,0,3),
64+
Offset = Vector(0, 0, 3),
6565

6666
ThinkDelay = 0.25,
6767
Divisor = 2.5, -- Divisor (pre-floor) and then multiplier to give a choppy angle
@@ -125,7 +125,7 @@ do -- Radar Receiver
125125
Mass = 25,
126126
Health = 10,
127127
Armor = 10,
128-
Offset = Vector(0,0,6),
128+
Offset = Vector(0, 0, 6),
129129

130130
ThinkDelay = 0.5,
131131
Divisor = 30, -- Divisor (pre-floor) and then multiplier to give a choppy angle

lua/effects/acf_glatgmexplosion.lua

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local Sounds = ACF.Utilities.Sounds
55
function EFFECT:Init(Data)
66
self.DirVec = Data:GetNormal()
77
self.Origin = Data:GetOrigin() + self.DirVec * -15
8-
self.Radius = math.Clamp(Data:GetScale() * 0.042 ,0.1,10)
8+
self.Radius = math.Clamp(Data:GetScale() * 0.042, 0.1, 10)
99

1010
self.Emitter = ParticleEmitter(self.Origin)
1111
self.ParticleMul = LocalPlayer():GetInfoNum("acf_cl_particlemul", 1)
@@ -44,7 +44,7 @@ function EFFECT:Airburst()
4444
EF:SetEndSize(30 * Radius)
4545
EF:SetRoll(800)
4646
EF:SetRollDelta(math.random(-1, 1))
47-
EF:SetColor(255,255,255)
47+
EF:SetColor(255, 255, 255)
4848
end
4949
local EI = 20 * Radius * Mult
5050
for E = 0, EI do
@@ -59,7 +59,7 @@ function EFFECT:Airburst()
5959
EF:SetEndSize(0)
6060
EF:SetRoll(800)
6161
EF:SetRollDelta(math.random(-1, 1))
62-
EF:SetColor(255,255,255)
62+
EF:SetColor(255, 255, 255)
6363
end
6464
end
6565
EI = 10 * Radius * Mult
@@ -75,18 +75,18 @@ function EFFECT:Airburst()
7575
EF:SetEndSize(0)
7676
EF:SetRoll(800)
7777
EF:SetRollDelta(math.random(-1, 1))
78-
EF:SetColor(255,255,255)
78+
EF:SetColor(255, 255, 255)
7979
end
8080
end
8181
local Angle = self.DirVec:Angle()
82-
Angle:RotateAroundAxis(Angle:Forward(), math.random(1,300))
83-
local rv = math.random(20,40) * Mult
82+
Angle:RotateAroundAxis(Angle:Forward(), math.random(1, 300))
83+
local rv = math.random(20, 40) * Mult
8484
for _ = 0, rv do
8585
Angle:RotateAroundAxis(Angle:Forward(), 360 / rv)
8686
EF = self.Emitter:Add("particle/smokesprites_000" .. math.random(1, 9), Origin)
8787
if EF then
88-
EF:SetVelocity((Angle:Up() - self.DirVec * math.random(0.05,0.25)) * math.random(200,300) * Radius)
89-
EF:SetDieTime(math.random(0.35,0.8))
88+
EF:SetVelocity((Angle:Up() - self.DirVec * math.random(0.05, 0.25)) * math.random(200, 300) * Radius)
89+
EF:SetDieTime(math.random(0.35, 0.8))
9090
EF:SetStartAlpha(100)
9191
EF:SetEndAlpha(0)
9292
EF:SetStartSize(15 * Radius)
@@ -99,19 +99,19 @@ function EFFECT:Airburst()
9999
end
100100
local Spark = Emitter:Add("particles/flamelet" .. math.random(1, 5), self.Origin)
101101
if Spark then
102-
Spark:SetVelocity((Angle:Up() - self.DirVec * math.random(-0.5,1)) * math.random(40,100) * Radius)
102+
Spark:SetVelocity((Angle:Up() - self.DirVec * math.random(-0.5, 1)) * math.random(40, 100) * Radius)
103103
Spark:SetLifeTime(0)
104104
Spark:SetDieTime(math.Rand(2, 8) * self.Radius)
105105
Spark:SetStartAlpha(255)
106106
Spark:SetEndAlpha(20)
107-
Spark:SetStartSize(math.random(2,4) * 0.2 * self.Radius)
107+
Spark:SetStartSize(math.random(2, 4) * 0.2 * self.Radius)
108108
Spark:SetEndSize(0 * self.Radius)
109-
Spark:SetStartLength(math.random(2,7) * 0.5 * self.Radius)
109+
Spark:SetStartLength(math.random(2, 7) * 0.5 * self.Radius)
110110
Spark:SetEndLength(0)
111111
Spark:SetRoll(math.Rand(0, 360))
112112
Spark:SetRollDelta(math.Rand(-0.2, 0.2))
113113
Spark:SetAirResistance(10)
114-
Spark:SetGravity(Vector(0,0,-400))
114+
Spark:SetGravity(Vector(0, 0, -400))
115115
Spark:SetColor(200, 200, 200)
116116
Spark:SetCollide(true)
117117
Spark:SetBounce(0.2)
@@ -145,7 +145,7 @@ function EFFECT:Airburst()
145145
AirBurst:SetEndSize(100 * Radius)
146146
AirBurst:SetRoll(math.Rand(150, 360))
147147
AirBurst:SetRollDelta(math.Rand(-0.2, 0.2))
148-
AirBurst:SetAirResistance(math.random(70,120))
148+
AirBurst:SetAirResistance(math.random(70, 120))
149149
AirBurst:SetGravity(Vector(math.random(-10, 10) * Radius, math.random(-10, 10) * Radius, 20))
150150
AirBurst:SetColor(200, 200, 200)
151151
end

lua/entities/acf_rack/cl_init.lua

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ do -- Overlay/networking
2020
net.SendToServer()
2121
end
2222

23-
net.Receive("ACF.RequestRackInfo",function()
23+
net.Receive("ACF.RequestRackInfo", function()
2424
local Rack = net.ReadEntity()
2525
if not IsValid(Rack) then return end
2626

@@ -45,19 +45,19 @@ do -- Overlay/networking
4545

4646
Rack.MountPoints = {}
4747
if next(RackInfo.MountPoints) then
48-
for _,T in ipairs(RackInfo.MountPoints) do
49-
local Dir = Vector(1,0,0)
48+
for _, T in ipairs(RackInfo.MountPoints) do
49+
local Dir = Vector(1, 0, 0)
5050
Dir:Rotate(T.Ang)
5151
Rack.MountPoints[#Rack.MountPoints + 1] = {Index = T.Index, Pos = T.Pos, Dir = Dir}
5252
end
5353
end
5454

5555
local CrateEnts = {}
56-
for _,E in ipairs(CrateInfo) do
56+
for _, E in ipairs(CrateInfo) do
5757
local Crate = Entity(E)
5858

5959
if IsValid(Crate) then
60-
local Col = ColorAlpha(Crate:GetColor(),25)
60+
local Col = ColorAlpha(Crate:GetColor(), 25)
6161
CrateEnts[#CrateEnts + 1] = {Ent = Crate, Col = Col}
6262
end
6363
end
@@ -71,9 +71,9 @@ do -- Overlay/networking
7171
-- icon16/joystick.png controller sprite
7272
local RadarSprite = Material("icon16/transmit.png")
7373
local JoystickMat = Material("icon16/joystick.png")
74-
local RadarColor = Color(255,255,0,25)
75-
local ControllerColor = Color(0,255,0,25)
76-
local ForwardColor = Color(255,0,0)
74+
local RadarColor = Color(255, 255, 0, 25)
75+
local ControllerColor = Color(0, 255, 0, 25)
76+
local ForwardColor = Color(255, 0, 0)
7777

7878
function ENT:DrawOverlay()
7979
local SelfTbl = self:GetTable()
@@ -86,37 +86,37 @@ do -- Overlay/networking
8686
end
8787

8888
if next(SelfTbl.Crates) then
89-
for _,T in ipairs(SelfTbl.Crates) do
89+
for _, T in ipairs(SelfTbl.Crates) do
9090
local E = T.Ent
9191

9292
if IsValid(E) then
93-
render.DrawWireframeBox(E:GetPos(),E:GetAngles(),E:OBBMins(),E:OBBMaxs(),T.Col,true)
94-
render.DrawBox(E:GetPos(),E:GetAngles(),E:OBBMins(),E:OBBMaxs(),T.Col)
93+
render.DrawWireframeBox(E:GetPos(), E:GetAngles(), E:OBBMins(), E:OBBMaxs(), T.Col, true)
94+
render.DrawBox(E:GetPos(), E:GetAngles(), E:OBBMins(), E:OBBMaxs(), T.Col)
9595
end
9696
end
9797
end
9898

9999
if next(SelfTbl.MountPoints) then
100-
for _,T in ipairs(SelfTbl.MountPoints) do
100+
for _, T in ipairs(SelfTbl.MountPoints) do
101101
local Pos1 = self:LocalToWorld(T.Pos - T.Dir * 6)
102102
local Pos2 = self:LocalToWorld(T.Pos + T.Dir * 6)
103103
render.DrawBeam(Pos1, Pos2, 2, 0, 0, color_black)
104104
render.DrawBeam(Pos1, Pos2, 1.5, 0, 0, color_white)
105105
end
106106

107107
cam.Start2D()
108-
for _,T in ipairs(SelfTbl.MountPoints) do
108+
for _, T in ipairs(SelfTbl.MountPoints) do
109109
local Pos = self:LocalToWorld(T.Pos):ToScreen()
110-
draw.SimpleTextOutlined("Mount " .. T.Index,"ACF_Title",Pos.x,Pos.y,color_white,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,1,color_black)
110+
draw.SimpleTextOutlined("Mount " .. T.Index, "ACF_Title", Pos.x, Pos.y, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
111111
end
112112
cam.End2D()
113113
end
114114

115115
if IsValid(SelfTbl.Radar) then
116116
local Radar = SelfTbl.Radar
117117
local RadPos, RadAng, OBBMin, OBBMax = Radar:GetPos(), Radar:GetAngles(), Radar:OBBMins(), Radar:OBBMaxs()
118-
render.DrawWireframeBox(RadPos,RadAng,OBBMin,OBBMax,RadarColor,true)
119-
render.DrawBox(RadPos,RadAng,OBBMin,OBBMax,RadarColor)
118+
render.DrawWireframeBox(RadPos, RadAng, OBBMin, OBBMax, RadarColor, true)
119+
render.DrawBox(RadPos, RadAng, OBBMin, OBBMax, RadarColor)
120120

121121
render.SetMaterial(RadarSprite)
122122
render.DrawSprite(Radar:LocalToWorld(Radar:OBBCenter()), 12, 12, color_white)
@@ -127,8 +127,8 @@ do -- Overlay/networking
127127
if IsValid(SelfTbl.Computer) then
128128
local Computer = SelfTbl.Computer
129129
local ComPos, ComAng, OBBMin, OBBMax = Computer:GetPos(), Computer:GetAngles(), Computer:OBBMins(), Computer:OBBMaxs()
130-
render.DrawWireframeBox(ComPos,ComAng,OBBMin,OBBMax,ControllerColor,true)
131-
render.DrawBox(ComPos,ComAng,OBBMin,OBBMax,ControllerColor)
130+
render.DrawWireframeBox(ComPos, ComAng, OBBMin, OBBMax, ControllerColor, true)
131+
render.DrawBox(ComPos, ComAng, OBBMin, OBBMax, ControllerColor)
132132

133133
render.SetMaterial(JoystickMat)
134134
render.DrawSprite(Computer:LocalToWorld(Computer:OBBCenter()), 12, 12, color_white)

lua/entities/acf_rack/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ do -- Overlay/networking
795795

796796
RackInfo.MountPoints = {}
797797

798-
for _,Point in pairs(Rack.MountPoints) do
798+
for _, Point in pairs(Rack.MountPoints) do
799799
RackInfo.MountPoints[#RackInfo.MountPoints + 1] = {Pos = Point.Position, Ang = Point.Angle, Index = Point.Index}
800800
end
801801

lua/entities/acf_radar/cl_init.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ do -- Overlay/networking
2020
net.SendToServer()
2121
end
2222

23-
net.Receive("ACF.RequestRadarInfo",function()
23+
net.Receive("ACF.RequestRadarInfo", function()
2424
local Radar = net.ReadEntity()
2525
if not IsValid(Radar) then return end
2626

@@ -37,8 +37,8 @@ do -- Overlay/networking
3737
Radar.Age = Clock.CurTime + 5
3838
end)
3939

40-
local Col = Color(255,255,0,25)
41-
local Col2 = Color(255,255,0)
40+
local Col = Color(255, 255, 0, 25)
41+
local Col2 = Color(255, 255, 0)
4242
function ENT:DrawOverlay()
4343
local SelfTbl = self:GetTable()
4444

@@ -51,17 +51,17 @@ do -- Overlay/networking
5151

5252
local Origin = self:LocalToWorld(SelfTbl.Origin)
5353
if SelfTbl.Spherical then
54-
render.DrawWireframeSphere(Origin,SelfTbl.Range,50,50,Col2)
54+
render.DrawWireframeSphere(Origin, SelfTbl.Range, 50, 50, Col2)
5555
else
5656

5757
for I = 0, 7 do
58-
local Dir = Vector(16384,0,0)
59-
Dir:Rotate(Angle(SelfTbl.Cone,0,0))
60-
Dir:Rotate(Angle(0,0,45 * I))
58+
local Dir = Vector(16384, 0, 0)
59+
Dir:Rotate(Angle(SelfTbl.Cone, 0, 0))
60+
Dir:Rotate(Angle(0, 0, 45 * I))
6161
local Point = self:LocalToWorld(SelfTbl.Origin + Dir)
62-
local Dir2 = Vector(16384,0,0)
63-
Dir2:Rotate(Angle(SelfTbl.Cone,0,0))
64-
Dir2:Rotate(Angle(0,0,45 * (I + 1)))
62+
local Dir2 = Vector(16384, 0, 0)
63+
Dir2:Rotate(Angle(SelfTbl.Cone, 0, 0))
64+
Dir2:Rotate(Angle(0, 0, 45 * (I + 1)))
6565
local Point2 = self:LocalToWorld(SelfTbl.Origin + Dir2)
6666

6767
render.DrawQuad(Origin, Point, Point2, Point, Col)

lua/entities/acf_radar/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ local function ScanForEntities(Entity)
169169
for Ent in pairs(Detected) do
170170
local EntPos = Ent.Position or Ent:GetPos()
171171

172-
if CheckLOS(Origin, EntPos) and (math.Rand(0,1) >= (EntDamage / 10)) then
172+
if CheckLOS(Origin, EntPos) and (math.Rand(0, 1) >= (EntDamage / 10)) then
173173
local EntSpread = VectorRand(-Spread, Spread)
174174
local EntVel = Ent.Velocity or Ent:GetVelocity()
175175
local Owner = GetEntityOwner(Entity.Owner, Ent)
@@ -559,14 +559,14 @@ end
559559

560560
do -- Overlay/networking
561561
util.AddNetworkString("ACF.RequestRadarInfo")
562-
net.Receive("ACF.RequestRadarInfo",function(_,Ply)
562+
net.Receive("ACF.RequestRadarInfo", function(_, Ply)
563563
local Radar = net.ReadEntity()
564564
if not IsValid(Radar) then return end
565565

566566
local RadarInfo = {}
567567
RadarInfo.Spherical = (Radar.ConeDegs == nil) and true or false
568568
RadarInfo.Cone = Radar.ConeDegs and math.Round(Radar.ConeDegs, 2) or 0
569-
RadarInfo.Range = Radar.Range and math.Round(Radar.Range,2) or 0
569+
RadarInfo.Range = Radar.Range and math.Round(Radar.Range, 2) or 0
570570
RadarInfo.Origin = Radar.Origin
571571

572572
net.Start("ACF.RequestRadarInfo")

lua/entities/acf_receiver/init.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ local function CheckReceive(Entity)
4444
for Ent in pairs(Sources) do
4545
local EntPos = Ent.Position or Ent:GetPos()
4646
local EntDamage = Entity.Damage
47-
local Spread = math.max(Entity.Divisor,15) * 2 * EntDamage
47+
local Spread = math.max(Entity.Divisor, 15) * 2 * EntDamage
4848

49-
if Entity.CheckLOS(Entity, Ent, Origin, EntPos) and (math.Rand(0,1) >= (EntDamage / 5)) then
49+
if Entity.CheckLOS(Entity, Ent, Origin, EntPos) and (math.Rand(0, 1) >= (EntDamage / 5)) then
5050
IsDetected = true
5151

5252
local PreAng = (EntPos - Origin):GetNormalized():Angle()
53-
Ang = Angle(math.Round((PreAng.p + math.random(-Spread,Spread)) / Entity.Divisor),math.Round((PreAng.y + math.random(-Spread,Spread)) / Entity.Divisor),0) * Entity.Divisor
53+
Ang = Angle(math.Round((PreAng.p + math.random(-Spread, Spread)) / Entity.Divisor), math.Round((PreAng.y + math.random(-Spread, Spread)) / Entity.Divisor), 0) * Entity.Divisor
5454
Dir = Ang:Forward()
5555

5656
break -- Stop at the first valid source
@@ -72,7 +72,7 @@ local function CheckReceive(Entity)
7272
WireLib.TriggerOutput(Entity, "Angle", Ang)
7373
end
7474

75-
local function SetActive(Entity,Bool)
75+
local function SetActive(Entity, Bool)
7676
ResetOutputs(Entity)
7777

7878
if Bool then
@@ -220,7 +220,7 @@ do -- Spawn and Update functions
220220

221221
CheckLegal(Receiver)
222222

223-
SetActive(Receiver,true)
223+
SetActive(Receiver, true)
224224

225225
return Receiver
226226
end
@@ -303,13 +303,13 @@ end
303303
function ENT:Enable()
304304
if not CheckLegal(self) then return end
305305

306-
SetActive(self,true)
306+
SetActive(self, true)
307307

308308
self:UpdateOverlay()
309309
end
310310

311311
function ENT:Disable()
312-
SetActive(self,false)
312+
SetActive(self, false)
313313
end
314314

315315
local Text = "%s\n\n%s"

0 commit comments

Comments
 (0)