Skip to content

Commit

Permalink
Fix debris error
Browse files Browse the repository at this point in the history
Also trying to slightly unbreak the weapons menu
  • Loading branch information
thecraftianman committed Jan 22, 2025
1 parent edc34df commit 81355df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions lua/acf/damage/debris_cl.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local ACF = ACF

local ACF = ACF
local Damage = ACF.Damage
local Effects = ACF.Utilities.Effects
local AllowDebris = GetConVar("acf_debris")
local AutoLod = GetConVar("acf_debris_autolod")
Expand Down Expand Up @@ -192,7 +192,7 @@ local function CreateGib(Position, Angles, Material, Color, Normal, Power, Min,
return true
end

function ACF.CreateDebris(Model, Position, Angles, Material, Color, Normal, Power, CanGib, Ignite)
function Damage.CreateDebris(Model, Position, Angles, Material, Color, Normal, Power, CanGib, Ignite)
if not AllowDebris:GetBool() then return end
if not Model then return end

Expand Down Expand Up @@ -238,7 +238,7 @@ local function SpawnDebris(EntID, Normal, Power, CanGib, Ignite)

local NewColor = EntInfo.Color:ToVector() * math.Rand(0.3, 0.6)

ACF.CreateDebris(
Damage.CreateDebris(
EntInfo.Model,
EntInfo.Position,
EntInfo.Angles,
Expand Down
14 changes: 6 additions & 8 deletions lua/acf/menu/items_cl/ammo_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ end
---If the first is defined, this function will effectively do nothing.
---If the latter is defined, only the information regarding the ammo crate (armor, mass and capacity by default) will be omitted.
---@param ToolData table<string, any> The copy of the local player's client data variables.
local function AddInformation(Base, ToolData)
local function AddCrateInformation(Base, ToolData)
if Ammo.PreCreateCrateInformation then
local Result = Ammo:PreCreateCrateInformation(Base, ToolData, BulletData)

Expand Down Expand Up @@ -243,6 +243,8 @@ local function AddInformation(Base, ToolData)

if not Result then return end

AddCrateInformation(Base, ToolData)

if Ammo.OnCreateAmmoInformation then
Ammo:OnCreateAmmoInformation(Base, ToolData, BulletData)
end
Expand Down Expand Up @@ -370,8 +372,7 @@ end

---Updates and populates the current ammunition menu.
---@param Menu userdata The panel in which the entire ACF menu is being placed on.
---@param Settings? table<string, boolean> The lookup table containing all the settings for the menu.
function ACF.UpdateAmmoMenu(Menu, Settings)
function ACF.UpdateAmmoMenu(Menu)
if not Ammo then return end

local ToolData = ACF.GetAllClientData()
Expand All @@ -397,15 +398,12 @@ function ACF.UpdateAmmoMenu(Menu, Settings)
Ammo:OnCreateAmmoMenu(Base, ToolData, BulletData)
end

if not Settings.SuppressMenu then
AddGraph(Base, ToolData)
end

hook.Run("ACF_OnCreateAmmoMenu", Base, ToolData, Ammo, BulletData)

AddPreview(Base, ToolData)
AddControls(Base, ToolData)
AddInformation(Base, ToolData)
AddGraph(Base, ToolData)

Menu:EndTemporal(Base)
end
Expand Down Expand Up @@ -474,7 +472,7 @@ function ACF.CreateAmmoMenu(Menu)

Desc:SetText(Data.Description)

ACF.UpdateAmmoMenu(Menu, {})
ACF.UpdateAmmoMenu(Menu)
end

Menu.AmmoBase = Base
Expand Down
1 change: 0 additions & 1 deletion lua/acf/menu/items_cl/scanner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ This was designed to help the community hold each other accountable, and can hel

playerList:AddColumn("Player Name")
local function PopulatePlayerList()
print("PopulatePlayerList called")
local _, selected = playerList:GetSelectedLine()
if IsValid(selected) and IsValid(selected.player) then
selected = selected.player
Expand Down

0 comments on commit 81355df

Please sign in to comment.