Skip to content

Commit

Permalink
Increased link distance
Browse files Browse the repository at this point in the history
- Increased weapon to computer, weapon to radar and rack to ammo linking distance to 650 inches.
  • Loading branch information
TwistedTail committed Feb 7, 2021
1 parent d45e9bc commit a098f6b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 5 additions & 3 deletions lua/entities/acf_computer/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,18 @@ end)
local CheckLegal = ACF_CheckLegal
local Components = ACF.Classes.Components
local UnlinkSound = "physics/metal/metal_box_impact_bullet%s.wav"
local MaxDistance = ACF.RefillDistance * ACF.RefillDistance
local MaxDistance = ACF.LinkDistance * ACF.LinkDistance
local HookRun = hook.Run

local function CheckDistantLinks(Entity, Source)
local Position = Entity:GetPos()

for Link in pairs(Entity[Source]) do
if Position:DistToSqr(Link:GetPos()) > MaxDistance then
Entity:EmitSound(UnlinkSound:format(math.random(1, 3)), 70, 100, ACF.Volume)
Link:EmitSound(UnlinkSound:format(math.random(1, 3)), 70, 100, ACF.Volume)
local Sound = UnlinkSound:format(math.random(1, 3))

Entity:EmitSound(Sound, 70, 100, ACF.Volume)
Link:EmitSound(Sound, 70, 100, ACF.Volume)

Entity:Unlink(Link)
end
Expand Down
2 changes: 1 addition & 1 deletion lua/entities/acf_rack/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ACF = ACF

do -- Spawning and Updating --------------------
local UnlinkSound = "physics/metal/metal_box_impact_bullet%s.wav"
local MaxDistance = ACF.RefillDistance * ACF.RefillDistance
local MaxDistance = ACF.LinkDistance * ACF.LinkDistance
local CheckLegal = ACF_CheckLegal
local Racks = ACF.Classes.Racks

Expand Down
8 changes: 5 additions & 3 deletions lua/entities/acf_radar/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ local Radars = ACF.ActiveRadars
local CheckLegal = ACF_CheckLegal
local Sensors = ACF.Classes.Sensors
local UnlinkSound = "physics/metal/metal_box_impact_bullet%s.wav"
local MaxDistance = ACF.RefillDistance * ACF.RefillDistance
local MaxDistance = ACF.LinkDistance * ACF.LinkDistance
local TraceData = { start = true, endpos = true, mask = MASK_SOLID_BRUSHONLY }
local Indexes = {}
local Unused = {}
Expand Down Expand Up @@ -266,8 +266,10 @@ local function CheckDistantLinks(Entity, Source)

for Link in pairs(Entity[Source]) do
if Position:DistToSqr(Link:GetPos()) > MaxDistance then
Entity:EmitSound(UnlinkSound:format(math.random(1, 3)), 70, 100, ACF.Volume)
Link:EmitSound(UnlinkSound:format(math.random(1, 3)), 70, 100, ACF.Volume)
local Sound = UnlinkSound:format(math.random(1, 3))

Entity:EmitSound(Sound, 70, 100, ACF.Volume)
Link:EmitSound(Sound, 70, 100, ACF.Volume)

Entity:Unlink(Link)
end
Expand Down

0 comments on commit a098f6b

Please sign in to comment.