From 05abc4325377270a1d7e4b6e050e247de7b6d425 Mon Sep 17 00:00:00 2001 From: TwistedTail <8784231+TwistedTail@users.noreply.github.com> Date: Fri, 2 Jun 2023 15:53:29 -0400 Subject: [PATCH 01/12] Updated all ammo creation related hook uses to the latest commit --- lua/acf/entities/ammo_types/flare.lua | 14 +++++++------- lua/acf/entities/ammo_types/glatgm.lua | 12 ++++++------ lua/acf/menu/items_cl/missiles.lua | 9 ++++++--- lua/acf/missiles/acfm_roundinject.lua | 14 +------------- 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/lua/acf/entities/ammo_types/flare.lua b/lua/acf/entities/ammo_types/flare.lua index 82f6a080..84f23da2 100644 --- a/lua/acf/entities/ammo_types/flare.lua +++ b/lua/acf/entities/ammo_types/flare.lua @@ -123,11 +123,11 @@ else function Ammo:ImpactEffect() end - function Ammo:SetupAmmoMenuSettings(Settings) - Settings.SuppressTracer = true + function Ammo:PreCreateTracerControls() + return false end - function Ammo:AddAmmoControls(Base, ToolData, BulletData) + function Ammo:OnCreateAmmoControls(Base, ToolData, BulletData) local FillerRatio = Base:AddSlider("Filler Ratio", 0, 1, 2) FillerRatio:SetClientData("FillerRatio", "OnValueChanged") FillerRatio:DefineSetter(function(_, _, Key, Value) @@ -141,13 +141,13 @@ else end) end - function Ammo:AddCrateDataTrackers(Trackers, ...) - Ammo.BaseClass.AddCrateDataTrackers(self, Trackers, ...) + function Ammo:OnCreateCrateInformation(Base, Label, ...) + Ammo.BaseClass.OnCreateCrateInformation(self, Base, Label, ...) - Trackers.FillerRatio = true + Label:TrackClientData("FillerRatio") end - function Ammo:AddAmmoInformation(Base, ToolData, BulletData) + function Ammo:OnCreateAmmoInformation(Base, ToolData, BulletData) local RoundStats = Base:AddLabel() RoundStats:TrackClientData("Projectile", "SetText") RoundStats:TrackClientData("Propellant") diff --git a/lua/acf/entities/ammo_types/glatgm.lua b/lua/acf/entities/ammo_types/glatgm.lua index 95ecd8ac..b3d04b3a 100644 --- a/lua/acf/entities/ammo_types/glatgm.lua +++ b/lua/acf/entities/ammo_types/glatgm.lua @@ -98,12 +98,12 @@ else end end - function Ammo:SetupAmmoMenuSettings(Settings) - Settings.SuppressTracer = true + function Ammo:PreCreateTracerControls() + return false end - function Ammo:AddAmmoPreview(Preview, Setup, ToolData, BulletData) - Ammo.BaseClass.AddAmmoPreview(self, Preview, Setup, ToolData, BulletData) + function Ammo:OnCreateAmmoPreview(Preview, Setup, ToolData, BulletData) + Ammo.BaseClass.OnCreateAmmoPreview(self, Preview, Setup, ToolData, BulletData) local Caliber = BulletData.Caliber local Model, FOV, Height @@ -125,7 +125,7 @@ else Setup.Height = Height or Setup.Height end - function Ammo:AddAmmoControls(Base, ToolData, BulletData) + function Ammo:OnCreateAmmoControls(Base, ToolData, BulletData) local LinerAngle = Base:AddSlider("Liner Angle", BulletData.MinConeAng, 90, 1) LinerAngle:SetClientData("LinerAngle", "OnValueChanged") LinerAngle:TrackClientData("Projectile") @@ -153,7 +153,7 @@ else end) end - function Ammo:AddAmmoInformation(Base, ToolData, BulletData) + function Ammo:OnCreateAmmoInformation(Base, ToolData, BulletData) local RoundStats = Base:AddLabel() RoundStats:TrackClientData("Projectile", "SetText") RoundStats:TrackClientData("Propellant") diff --git a/lua/acf/menu/items_cl/missiles.lua b/lua/acf/menu/items_cl/missiles.lua index 2aff0f6b..f319ffda 100644 --- a/lua/acf/menu/items_cl/missiles.lua +++ b/lua/acf/menu/items_cl/missiles.lua @@ -2,7 +2,6 @@ local ACF = ACF local Classes = ACF.Classes local Missiles = Classes.Missiles local Racks = Classes.Racks -local Settings = { SuppressTracer = true } local function GetRackList(Data) local Result = {} @@ -78,7 +77,7 @@ local function CreateMenu(Menu) local RackPreview = RackBase:AddModelPreview(nil, true) local RackInfo = RackBase:AddLabel() - local AmmoList = ACF.CreateAmmoMenu(Menu, Settings) + local AmmoList = ACF.CreateAmmoMenu(Menu) ACF.SetClientData("PrimaryClass", "acf_rack") ACF.SetClientData("SecondaryClass", "acf_ammo") @@ -120,7 +119,7 @@ local function CreateMenu(Menu) Menu.AmmoBase.MissileData = Data - ACF.UpdateAmmoMenu(Menu, Settings) + ACF.UpdateAmmoMenu(Menu) end function RackList:OnSelect(Index, _, Data) @@ -142,3 +141,7 @@ local function CreateMenu(Menu) end ACF.AddMenuItem(101, "Entities", "Missiles", "wand", CreateMenu) + +hook.Add("ACF_PreCreateTraceControls", "ACF Missiles Remove Tracer Checkbox", function(_, ToolData) + if ToolData.PrimaryClass == "acf_rack" then return false end +end) diff --git a/lua/acf/missiles/acfm_roundinject.lua b/lua/acf/missiles/acfm_roundinject.lua index 7075f56c..0803d393 100644 --- a/lua/acf/missiles/acfm_roundinject.lua +++ b/lua/acf/missiles/acfm_roundinject.lua @@ -51,7 +51,7 @@ if CLIENT then return Result end - hook.Add("ACF_AddAmmoControls", "ACF Add Missiles Menu", function(Base, ToolData, Ammo, BulletData) + hook.Add("ACF_OnCreateAmmoControls", "ACF Add Missiles Menu", function(Base, ToolData, Ammo, BulletData) if ToolData.Destiny ~= "Missiles" then return end local Missile = Base.MissileData @@ -123,18 +123,6 @@ if CLIENT then ACF.LoadSortedList(GuidanceList, GetGuidanceList(Missile), "Name") ACF.LoadSortedList(FuzeList, GetFuzeList(Missile), "Name") end) - - --[[ - -- Unused, uncomment if needed - hook.Add("ACF_AddAmmoInformation", "ACF Add Missiles Menu", function(Base, ToolData, Ammo, BulletData) - if ToolData.Destiny ~= "Missiles" then return end - - local Guidance = BulletData.Guidance - local Fuze = BulletData.Fuze - local GuidanceBase = Base:AddPanel("ACF_Panel") - local FuzeBase = Base:AddPanel("ACF_Panel") - end) - ]] else local Display = "%s: %s%s\n\n%s: %s%s" local AllowedClass = { From 51a77d10ab0d2694bf2b26d1b17cf7f702464db2 Mon Sep 17 00:00:00 2001 From: TwistedTail <8784231+TwistedTail@users.noreply.github.com> Date: Fri, 2 Jun 2023 18:43:10 -0400 Subject: [PATCH 02/12] Updated flare effect override to comply with latest changes --- lua/acf/missiles/acfm_effects_cl.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/acf/missiles/acfm_effects_cl.lua b/lua/acf/missiles/acfm_effects_cl.lua index 8c3a39d7..b1aaf320 100644 --- a/lua/acf/missiles/acfm_effects_cl.lua +++ b/lua/acf/missiles/acfm_effects_cl.lua @@ -49,10 +49,10 @@ local Overrides = end } -hook.Add("ACF_BulletEffect", "ACF Missiles Custom Effects", function(AmmoType) - local Custom = Overrides[AmmoType] +hook.Add("ACF_OnCreateBulletEffect", "ACF Missiles Custom Effects", function(Effect, BulletData) + local Custom = Overrides[BulletData.AmmoType] if Custom then - return Custom + Effect.ApplyMovement = Custom end end) From 4f928af1b311aa90667c8509c2efe64cf5843f4f Mon Sep 17 00:00:00 2001 From: TwistedTail <8784231+TwistedTail@users.noreply.github.com> Date: Sat, 3 Jun 2023 12:22:43 -0400 Subject: [PATCH 03/12] Updated uses of ACF_OnAddonLoaded hook --- lua/acf/core/acfm_globals.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/acf/core/acfm_globals.lua b/lua/acf/core/acfm_globals.lua index a77ec85a..a07e69ee 100644 --- a/lua/acf/core/acfm_globals.lua +++ b/lua/acf/core/acfm_globals.lua @@ -19,7 +19,9 @@ if SERVER then end do -- Update checker - hook.Add("ACF_OnAddonLoaded", "ACF Missiles Checker", function() + hook.Add("ACF_OnLoadAddon", "ACF Missiles Update Checker", function() ACF.AddRepository("TwistedTail", "ACF-3-Missiles", "lua/acf/core/acfm_globals.lua") + + hook.Remove("ACF_OnLoadAddon", "ACF Missiles Update Checker") end) end \ No newline at end of file From 713fd9ac3eeb6498a5b1d1ff766bda0d72abfe47 Mon Sep 17 00:00:00 2001 From: thecraftianman <64441307+thecraftianman@users.noreply.github.com> Date: Mon, 8 Jan 2024 19:55:24 -0500 Subject: [PATCH 04/12] Consistency with main addon hook docs --- lua/acf/core/laser/laser_sv.lua | 2 +- lua/acf/entities/components/computers.lua | 2 +- lua/acf/hooks/hooks_missiles_sv.lua | 9 +++++++++ lua/entities/acf_computer/init.lua | 12 ++++++------ lua/entities/acf_glatgm/init.lua | 6 ++++-- lua/entities/acf_missile/init.lua | 14 ++++++++------ lua/entities/acf_rack/init.lua | 15 ++++++++------- lua/entities/acf_radar/init.lua | 12 ++++++------ lua/entities/acf_receiver/init.lua | 12 ++++++------ 9 files changed, 49 insertions(+), 35 deletions(-) create mode 100644 lua/acf/hooks/hooks_missiles_sv.lua diff --git a/lua/acf/core/laser/laser_sv.lua b/lua/acf/core/laser/laser_sv.lua index bf0eafcc..24bdd16b 100644 --- a/lua/acf/core/laser/laser_sv.lua +++ b/lua/acf/core/laser/laser_sv.lua @@ -59,6 +59,6 @@ hook.Add("ACF_OnPlayerLoaded", "ACF Laser Setup", function(Player) net.Send(Player) end) -hook.Add("OnMissileLaunched", "ACF Laser Filter Update", function(Missile) +hook.Add("ACF_OnMissileLaunched", "ACF Laser Filter Update", function(Missile) ACF.FilterLaserEntity(Missile) end) diff --git a/lua/acf/entities/components/computers.lua b/lua/acf/entities/components/computers.lua index ffdc0ce5..545af550 100644 --- a/lua/acf/entities/components/computers.lua +++ b/lua/acf/entities/components/computers.lua @@ -266,7 +266,7 @@ do -- Optical guidance computer return math.floor(Value * 0.00254) * 393.7 end - hook.Add("OnMissileLaunched", "ACF Optical Computer Filter", function(Missile) + hook.Add("ACF_OnMissileLaunched", "ACF Optical Computer Filter", function(Missile) for Computer in pairs(Computers) do local Filter = Computer.Filter diff --git a/lua/acf/hooks/hooks_missiles_sv.lua b/lua/acf/hooks/hooks_missiles_sv.lua new file mode 100644 index 00000000..ca96bf47 --- /dev/null +++ b/lua/acf/hooks/hooks_missiles_sv.lua @@ -0,0 +1,9 @@ +local Hooks = ACF.Utilities.Hooks + + +Hooks.Add("ACF_Missiles_Server", function(Gamemode) + --- Called after a missile is fired. + -- @param Missile The missile entity that was launched. + function Gamemode:ACF_OnMissileLaunched() + end +end) diff --git a/lua/entities/acf_computer/init.lua b/lua/entities/acf_computer/init.lua index b8e892bf..aec5e1aa 100644 --- a/lua/entities/acf_computer/init.lua +++ b/lua/entities/acf_computer/init.lua @@ -4,6 +4,7 @@ AddCSLuaFile("cl_init.lua") include("shared.lua") +local hook = hook local ACF = ACF local Damage = ACF.Damage local Utilities = ACF.Utilities @@ -70,7 +71,6 @@ end) local CheckLegal = ACF.CheckLegal local UnlinkSound = "physics/metal/metal_box_impact_bullet%s.wav" local MaxDistance = ACF.LinkDistance * ACF.LinkDistance -local HookRun = hook.Run local function CheckDistantLinks(Entity, Source) local Position = Entity:GetPos() @@ -115,7 +115,7 @@ do -- Spawn and update function Class.VerifyData(Data, Class) end - HookRun("ACF_VerifyData", "acf_computer", Data, Class) + hook.Run("ACF_VerifyData", "acf_computer", Data, Class) end end @@ -228,7 +228,7 @@ do -- Spawn and update function Class.OnSpawn(Entity, Data, Class, Computer) end - HookRun("ACF_OnEntitySpawn", "acf_computer", Entity, Data, Class, Computer) + hook.Run("ACF_OnEntitySpawn", "acf_computer", Entity, Data, Class, Computer) WireLib.TriggerOutput(Entity, "Entity", Entity) @@ -271,7 +271,7 @@ do -- Spawn and update function OldClass.OnLast(self, OldClass) end - HookRun("ACF_OnEntityLast", "acf_computer", self, OldClass) + hook.Run("ACF_OnEntityLast", "acf_computer", self, OldClass) ACF.SaveEntity(self) @@ -283,7 +283,7 @@ do -- Spawn and update function Class.OnUpdate(self, Data, Class, Computer) end - HookRun("ACF_OnEntityUpdate", "acf_computer", self, Data, Class, Computer) + hook.Run("ACF_OnEntityUpdate", "acf_computer", self, Data, Class, Computer) self:UpdateOverlay(true) @@ -374,7 +374,7 @@ function ENT:OnRemove() OldClass.OnLast(self, OldClass) end - HookRun("ACF_OnEntityLast", "acf_computer", self, OldClass) + hook.Run("ACF_OnEntityLast", "acf_computer", self, OldClass) for Weapon in pairs(self.Weapons) do self:Unlink(Weapon) diff --git a/lua/entities/acf_glatgm/init.lua b/lua/entities/acf_glatgm/init.lua index 60459ece..51cf5c3a 100644 --- a/lua/entities/acf_glatgm/init.lua +++ b/lua/entities/acf_glatgm/init.lua @@ -32,7 +32,9 @@ local function ClampAngle(Object, Limit) end local function DetonateMissile(Missile, Inflictor) - if hook.Run("ACF_AmmoExplode", Missile, Missile.BulletData) == false then return end + local CanExplode = hook.Run("ACF_AmmoCanExplode", Missile, Missile.BulletData) + + if not CanExplode then return end if IsValid(Inflictor) and Inflictor:IsPlayer() then Missile.Inflictor = Inflictor @@ -115,7 +117,7 @@ function MakeACF_GLATGM(Gun, BulletData) Missiles[Entity] = true - hook.Run("OnMissileLaunched", Entity) + hook.Run("ACF_OnMissileLaunched", Entity) return Entity end diff --git a/lua/entities/acf_missile/init.lua b/lua/entities/acf_missile/init.lua index 63c58632..c71277ff 100644 --- a/lua/entities/acf_missile/init.lua +++ b/lua/entities/acf_missile/init.lua @@ -16,7 +16,7 @@ local Clock = ACF.Utilities.Clock local Damage = ACF.Damage local Missiles = Classes.Missiles local InputActions = ACF.GetInputActions("acf_missile") -local HookRun = hook.Run +local hook = hook local Inputs = { "Detonate (Force the missile to explode.)" } local Outputs = { "Entity (The missile itself.) [ENTITY]" } @@ -289,7 +289,9 @@ local function CalcFlight(Missile) end local function DetonateMissile(Missile, Inflictor) - if HookRun("ACF_AmmoExplode", Missile, Missile.BulletData) == false then return end + local CanExplode = hook.Run("ACF_AmmoCanExplode", Missile, Missile.BulletData) + + if not CanExplode then return end if IsValid(Inflictor) and Inflictor:IsPlayer() then Missile.Inflictor = Inflictor @@ -306,7 +308,7 @@ hook.Add("CanDrive", "acf_missile_CanDrive", function(_, Entity) if ActiveMissiles[Entity] then return false end end) -hook.Add("OnMissileLaunched", "ACF Missile Rack Filter", function(Missile) +hook.Add("ACF_OnMissileLaunched", "ACF Missile Rack Filter", function(Missile) local Count = #Missile.Filter for K in pairs(ActiveMissiles) do @@ -404,7 +406,7 @@ function MakeACF_Missile(Player, Pos, Ang, Rack, MountPoint, Crate) Missile.Inputs = WireLib.CreateInputs(Missile, Inputs) Missile.Outputs = WireLib.CreateOutputs(Missile, Outputs) - HookRun("ACF_OnEntitySpawn", "acf_missile", Missile, Data, Class, Crate) + hook.Run("ACF_OnEntitySpawn", "acf_missile", Missile, Data, Class, Crate) WireLib.TriggerOutput(Missile, "Entity", Missile) @@ -463,7 +465,7 @@ function ENT:CreateBulletData(Crate) Ammo:OnFirst(self) end - HookRun("ACF_OnAmmoFirst", Ammo, self, Data) + hook.Run("ACF_OnAmmoFirst", Ammo, self, Data) Ammo:Network(self, self.BulletData) end @@ -545,7 +547,7 @@ function ENT:Launch(Delay, IsMisfire) UpdateBodygroups(self, "OnLaunch") UpdateSkin(self) - HookRun("OnMissileLaunched", self) + hook.Run("ACF_OnMissileLaunched", self) end function ENT:DoFlight(ToPos, ToDir) diff --git a/lua/entities/acf_rack/init.lua b/lua/entities/acf_rack/init.lua index 63dbe355..c629ad26 100644 --- a/lua/entities/acf_rack/init.lua +++ b/lua/entities/acf_rack/init.lua @@ -6,7 +6,7 @@ include("shared.lua") -- Local Vars ----------------------------------- local EMPTY = { Type = "Empty", PropMass = 0, ProjMass = 0, Tracer = 0 } -local HookRun = hook.Run +local hook = hook local ACF = ACF local Classes = ACF.Classes local Utilities = ACF.Utilities @@ -72,7 +72,7 @@ do -- Spawning and Updating -------------------- Rack.VerifyData(Data, Rack) end - HookRun("ACF_VerifyData", "acf_rack", Data, Rack) + hook.Run("ACF_VerifyData", "acf_rack", Data, Rack) end end @@ -218,7 +218,7 @@ do -- Spawning and Updating -------------------- RackData.OnSpawn(Rack, Data, RackData) end - HookRun("ACF_OnEntitySpawn", "acf_rack", Rack, Data, RackData) + hook.Run("ACF_OnEntitySpawn", "acf_rack", Rack, Data, RackData) WireLib.TriggerOutput(Rack, "Rate of Fire", 60) WireLib.TriggerOutput(Rack, "Reload Time", 1) @@ -271,7 +271,7 @@ do -- Spawning and Updating -------------------- OldData.OnLast(self, OldData) end - HookRun("ACF_OnEntityLast", "acf_rack", self, OldData) + hook.Run("ACF_OnEntityLast", "acf_rack", self, OldData) ACF.SaveEntity(self) @@ -283,7 +283,7 @@ do -- Spawning and Updating -------------------- Rack.OnUpdate(self, Data, Rack) end - HookRun("ACF_OnEntityUpdate", "acf_rack", self, Data, Rack) + hook.Run("ACF_OnEntityUpdate", "acf_rack", self, Data, Rack) self:UpdateOverlay(true) @@ -537,8 +537,9 @@ do -- Firing ----------------------------------- function ENT:Shoot() local Index, Point = self:GetNextMountPoint("Loaded", self.PointIndex) local Delay = self.FireDelay + local CanFire = hook.Run("ACF_WeaponCanFire", self) - if Index and HookRun("ACF_FireShell", self) ~= false then + if Index and CanFire then ShootMissile(self, Point) self.PointIndex = self:GetNextMountPoint("Loaded", Index) or 1 @@ -880,7 +881,7 @@ do -- Misc ------------------------------------- OldData.OnLast(self, OldData) end - HookRun("ACF_OnEntityLast", "acf_rack", self, OldData) + hook.Run("ACF_OnEntityLast", "acf_rack", self, OldData) for Crate in pairs(self.Crates) do self:Unlink(Crate) diff --git a/lua/entities/acf_radar/init.lua b/lua/entities/acf_radar/init.lua index 152933fa..885aada3 100644 --- a/lua/entities/acf_radar/init.lua +++ b/lua/entities/acf_radar/init.lua @@ -49,7 +49,7 @@ local TraceLine = util.TraceLine local TimerExists = timer.Exists local TimerCreate = timer.Create local TimerRemove = timer.Remove -local HookRun = hook.Run +local hook = hook -- TODO: Optimize this so the entries are only cleared when the target is no longer detected by the radar local function ClearTargets(Entity) @@ -323,7 +323,7 @@ do -- Spawn and Update functions Class.VerifyData(Data, Class) end - HookRun("ACF_VerifyData", "acf_radar", Data, Class) + hook.Run("ACF_VerifyData", "acf_radar", Data, Class) end end @@ -420,7 +420,7 @@ do -- Spawn and Update functions Class.OnSpawn(Radar, Data, Class, RadarData) end - HookRun("ACF_OnEntitySpawn", "acf_radar", Radar, Data, Class, RadarData) + hook.Run("ACF_OnEntitySpawn", "acf_radar", Radar, Data, Class, RadarData) WireLib.TriggerOutput(Radar, "Entity", Radar) @@ -465,7 +465,7 @@ do -- Spawn and Update functions OldClass.OnLast(self, OldClass) end - HookRun("ACF_OnEntityLast", "acf_radar", self, OldClass) + hook.Run("ACF_OnEntityLast", "acf_radar", self, OldClass) ACF.SaveEntity(self) @@ -477,7 +477,7 @@ do -- Spawn and Update functions Class.OnUpdate(self, Data, Class, Radar) end - HookRun("ACF_OnEntityUpdate", "acf_radar", self, Data, Class, Radar) + hook.Run("ACF_OnEntityUpdate", "acf_radar", self, Data, Class, Radar) self:UpdateOverlay(true) @@ -545,7 +545,7 @@ function ENT:OnRemove() OldClass.OnLast(self, OldClass) end - HookRun("ACF_OnEntityLast", "acf_radar", self, OldClass) + hook.Run("ACF_OnEntityLast", "acf_radar", self, OldClass) for Weapon in pairs(self.Weapons) do self:Unlink(Weapon) diff --git a/lua/entities/acf_receiver/init.lua b/lua/entities/acf_receiver/init.lua index 53b89b12..e363e9ba 100644 --- a/lua/entities/acf_receiver/init.lua +++ b/lua/entities/acf_receiver/init.lua @@ -15,7 +15,7 @@ local CheckLegal = ACF.CheckLegal local TimerExists = timer.Exists local TimerCreate = timer.Create local TimerRemove = timer.Remove -local HookRun = hook.Run +local hook = hook local function ResetOutputs(Entity) if not Entity.Detected then return end @@ -122,7 +122,7 @@ do -- Spawn and Update functions Class.VerifyData(Data, Class) end - HookRun("ACF_VerifyData", "acf_receiver", Data, Class) + hook.Run("ACF_VerifyData", "acf_receiver", Data, Class) end end @@ -207,7 +207,7 @@ do -- Spawn and Update functions Class.OnSpawn(Receiver, Data, Class, ReceiverData) end - HookRun("ACF_OnEntitySpawn", "acf_receiver", Receiver, Data, Class, ReceiverData) + hook.Run("ACF_OnEntitySpawn", "acf_receiver", Receiver, Data, Class, ReceiverData) WireLib.TriggerOutput(Receiver, "Entity", Receiver) @@ -243,7 +243,7 @@ do -- Spawn and Update functions OldClass.OnLast(self, OldClass) end - HookRun("ACF_OnEntityLast", "acf_Receiver", self, OldClass) + hook.Run("ACF_OnEntityLast", "acf_Receiver", self, OldClass) ACF.SaveEntity(self) @@ -255,7 +255,7 @@ do -- Spawn and Update functions Class.OnUpdate(self, Data, Class, Receiver) end - HookRun("ACF_OnEntityUpdate", "acf_Receiver", self, Data, Class, Receiver) + hook.Run("ACF_OnEntityUpdate", "acf_Receiver", self, Data, Class, Receiver) self:UpdateOverlay(true) @@ -330,7 +330,7 @@ function ENT:OnRemove() OldClass.OnLast(self, OldClass) end - HookRun("ACF_OnEntityLast", "acf_Receiver", self, OldClass) + hook.Run("ACF_OnEntityLast", "acf_Receiver", self, OldClass) TimerRemove(self.TimerID) From 0eeb0af55584eb4c0f3d7573730b5edcfcea25f7 Mon Sep 17 00:00:00 2001 From: thecraftianman <64441307+thecraftianman@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:08:22 -0500 Subject: [PATCH 05/12] Swap to using ACF_MissileCanExplode hook --- lua/acf/hooks/hooks_missiles_sv.lua | 10 +++++++++- lua/entities/acf_glatgm/init.lua | 2 +- lua/entities/acf_missile/init.lua | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lua/acf/hooks/hooks_missiles_sv.lua b/lua/acf/hooks/hooks_missiles_sv.lua index ca96bf47..80a445aa 100644 --- a/lua/acf/hooks/hooks_missiles_sv.lua +++ b/lua/acf/hooks/hooks_missiles_sv.lua @@ -3,7 +3,15 @@ local Hooks = ACF.Utilities.Hooks Hooks.Add("ACF_Missiles_Server", function(Gamemode) --- Called after a missile is fired. - -- @param Missile The missile entity that was launched. + -- @param Entity The missile entity that was launched. function Gamemode:ACF_OnMissileLaunched() end + + --- Called when a missile attempts to create an explosion. + -- @param Entity The affected missile. + -- @param Data The bullet data of the affected missile. + -- @return True if the missile can explode, false otherwise. + function Gamemode:ACF_MissileCanExplode() + return true + end end) diff --git a/lua/entities/acf_glatgm/init.lua b/lua/entities/acf_glatgm/init.lua index 51cf5c3a..7f70cef6 100644 --- a/lua/entities/acf_glatgm/init.lua +++ b/lua/entities/acf_glatgm/init.lua @@ -32,7 +32,7 @@ local function ClampAngle(Object, Limit) end local function DetonateMissile(Missile, Inflictor) - local CanExplode = hook.Run("ACF_AmmoCanExplode", Missile, Missile.BulletData) + local CanExplode = hook.Run("ACF_MissileCanExplode", Missile, Missile.BulletData) if not CanExplode then return end diff --git a/lua/entities/acf_missile/init.lua b/lua/entities/acf_missile/init.lua index c71277ff..6956418c 100644 --- a/lua/entities/acf_missile/init.lua +++ b/lua/entities/acf_missile/init.lua @@ -289,7 +289,7 @@ local function CalcFlight(Missile) end local function DetonateMissile(Missile, Inflictor) - local CanExplode = hook.Run("ACF_AmmoCanExplode", Missile, Missile.BulletData) + local CanExplode = hook.Run("ACF_MissileCanExplode", Missile, Missile.BulletData) if not CanExplode then return end From ebe8891bf6baf2fd1e37f53a671a554cdc76d7c1 Mon Sep 17 00:00:00 2001 From: thecraftianman <64441307+thecraftianman@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:19:41 -0500 Subject: [PATCH 06/12] Sound Extension Project hook documentation This hook should probably just be removed entirely tbh --- lua/acf/hooks/hooks_missiles_sv.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/acf/hooks/hooks_missiles_sv.lua b/lua/acf/hooks/hooks_missiles_sv.lua index 80a445aa..1e7147d1 100644 --- a/lua/acf/hooks/hooks_missiles_sv.lua +++ b/lua/acf/hooks/hooks_missiles_sv.lua @@ -14,4 +14,11 @@ Hooks.Add("ACF_Missiles_Server", function(Gamemode) function Gamemode:ACF_MissileCanExplode() return true end + + --- Called when a missile plays its sound if the ACF Sound Extension Project by looterz is installed. + -- This is a legacy hook from ACF-2 and may be removed at any time. + -- @param Entity The missile entity to play sound on. + -- @param Sound The sound to play. + function Gamemode:ACF_SOUND_MISSILE() + end end) From 31eed1dea813385a0f54b38ab8821b17d733c69d Mon Sep 17 00:00:00 2001 From: TwistedTail <8784231+TwistedTail@users.noreply.github.com> Date: Sun, 18 Feb 2024 18:36:25 -0300 Subject: [PATCH 07/12] Updated use of shared hooks - Updated cases where renamed shared hooks were used. --- lua/acf/core/classes/missiles/ammo_blacklist.lua | 4 ++-- lua/acf/core/utilities/entity_tracking_sv.lua | 2 +- lua/acf/entities/ammo_types/flare.lua | 4 ++-- lua/acf/missiles/acfm_roundinject.lua | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/acf/core/classes/missiles/ammo_blacklist.lua b/lua/acf/core/classes/missiles/ammo_blacklist.lua index f1370155..896cba74 100644 --- a/lua/acf/core/classes/missiles/ammo_blacklist.lua +++ b/lua/acf/core/classes/missiles/ammo_blacklist.lua @@ -18,7 +18,7 @@ local function AddToBlacklist(Weapon, Ammo) end end -hook.Add("ACF_OnNewClassGroup", "ACF External Ammo Blacklist", function(ID, Group) +hook.Add("ACF_OnCreateGroup", "ACF External Ammo Blacklist", function(ID, Group) if not Group.Blacklist then return end for _, Ammo in ipairs(Group.Blacklist) do @@ -26,7 +26,7 @@ hook.Add("ACF_OnNewClassGroup", "ACF External Ammo Blacklist", function(ID, Grou end end) -hook.Add("ACF_OnClassLoaded", "ACF External Ammo Blacklist", function(ID, Class) +hook.Add("ACF_OnLoadClass", "ACF External Ammo Blacklist", function(ID, Class) if not AmmoTypes.Get(ID) then return end if not Blacklisted[ID] then return end diff --git a/lua/acf/core/utilities/entity_tracking_sv.lua b/lua/acf/core/utilities/entity_tracking_sv.lua index b23ad43f..2ee36213 100644 --- a/lua/acf/core/utilities/entity_tracking_sv.lua +++ b/lua/acf/core/utilities/entity_tracking_sv.lua @@ -94,7 +94,7 @@ hook.Add("PlayerSpawnedVehicle", "ACF Entity Tracking", function(_, Entity) end) end) -hook.Add("ACF_OnClock", "ACF Entity Tracking", function() +hook.Add("ACF_OnTick", "ACF Entity Tracking", function() for Ancestor in pairs(Ancestors) do UpdateValues(Ancestor) end diff --git a/lua/acf/entities/ammo_types/flare.lua b/lua/acf/entities/ammo_types/flare.lua index 84f23da2..1213bc2f 100644 --- a/lua/acf/entities/ammo_types/flare.lua +++ b/lua/acf/entities/ammo_types/flare.lua @@ -21,7 +21,7 @@ function Ammo:GetDisplayData(Data) BurnTime = Data.BurnTime, } - hook.Run("ACF_GetDisplayData", self, Data, Display) + hook.Run("ACF_OnGetDisplayData", self, Data, Display) return Display end @@ -40,7 +40,7 @@ function Ammo:UpdateRoundData(ToolData, Data, GUIData) Data.BurnTime = Data.FillerMass / Data.BurnRate Data.CartMass = Data.PropMass + Data.ProjMass - hook.Run("ACF_UpdateRoundData", self, ToolData, Data, GUIData) + hook.Run("ACF_OnUpdateRound", self, ToolData, Data, GUIData) for K, V in pairs(self:GetDisplayData(Data)) do GUIData[K] = V diff --git a/lua/acf/missiles/acfm_roundinject.lua b/lua/acf/missiles/acfm_roundinject.lua index a29d75fe..11b88b69 100644 --- a/lua/acf/missiles/acfm_roundinject.lua +++ b/lua/acf/missiles/acfm_roundinject.lua @@ -4,7 +4,7 @@ local Entities = Classes.Entities local Guidances = Classes.Guidances local Fuzes = Classes.Fuzes -hook.Add("ACF_UpdateRoundData", "ACF Missile Ammo", function(_, ToolData, Data) +hook.Add("ACF_OnUpdateRound", "ACF Missile Ammo", function(_, ToolData, Data) if ToolData.Destiny ~= "Missiles" then return end local PenMul = ACF.GetGunValue(ToolData.Weapon, "PenMul") From 03a020397fa1ae37f5184a1c3599b6ac12b72cb5 Mon Sep 17 00:00:00 2001 From: TwistedTail <8784231+TwistedTail@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:43:41 -0300 Subject: [PATCH 08/12] Updated use of ACF_OnPlayerLoaded --- lua/acf/core/laser/laser_sv.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/acf/core/laser/laser_sv.lua b/lua/acf/core/laser/laser_sv.lua index 24bdd16b..030a164f 100644 --- a/lua/acf/core/laser/laser_sv.lua +++ b/lua/acf/core/laser/laser_sv.lua @@ -53,7 +53,7 @@ function ACF.FilterLaserEntity(Entity) net.Broadcast() end -hook.Add("ACF_OnPlayerLoaded", "ACF Laser Setup", function(Player) +hook.Add("ACF_OnLoadPlayer", "ACF Laser Setup", function(Player) net.Start("ACF_SyncLaserSources") net.WriteTable(Sources) net.Send(Player) From 15251bb37d29b721d01eaee6913cf609cdb15b1f Mon Sep 17 00:00:00 2001 From: thecraftianman <64441307+thecraftianman@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:14:35 -0400 Subject: [PATCH 09/12] Standardize hook docs with function docs --- lua/acf/hooks/hooks_missiles_sv.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/acf/hooks/hooks_missiles_sv.lua b/lua/acf/hooks/hooks_missiles_sv.lua index 1e7147d1..741f205c 100644 --- a/lua/acf/hooks/hooks_missiles_sv.lua +++ b/lua/acf/hooks/hooks_missiles_sv.lua @@ -3,22 +3,22 @@ local Hooks = ACF.Utilities.Hooks Hooks.Add("ACF_Missiles_Server", function(Gamemode) --- Called after a missile is fired. - -- @param Entity The missile entity that was launched. + --- @param Entity entity The missile entity that was launched. function Gamemode:ACF_OnMissileLaunched() end --- Called when a missile attempts to create an explosion. - -- @param Entity The affected missile. - -- @param Data The bullet data of the affected missile. - -- @return True if the missile can explode, false otherwise. + --- @param Entity entity The affected missile. + --- @param Data table The bullet data of the affected missile. + --- @return boolean # True if the missile can explode, false otherwise. function Gamemode:ACF_MissileCanExplode() return true end --- Called when a missile plays its sound if the ACF Sound Extension Project by looterz is installed. - -- This is a legacy hook from ACF-2 and may be removed at any time. - -- @param Entity The missile entity to play sound on. - -- @param Sound The sound to play. + --- This is a legacy hook from ACF-2 and may be removed at any time. + --- @param Entity entity The missile entity to play sound on. + --- @param Sound string The sound to play. function Gamemode:ACF_SOUND_MISSILE() end end) From 08b62e0a03f2decc5867ea078b4e874df764eea7 Mon Sep 17 00:00:00 2001 From: thecraftianman <64441307+thecraftianman@users.noreply.github.com> Date: Thu, 19 Dec 2024 23:05:27 -0500 Subject: [PATCH 10/12] Update multiple serverside hook names --- lua/acf/hooks/hooks_missiles_sv.lua | 2 +- lua/acf/missiles/acfm_roundinject.lua | 2 +- lua/entities/acf_computer/init.lua | 2 +- lua/entities/acf_glatgm/init.lua | 2 +- lua/entities/acf_missile/init.lua | 2 +- lua/entities/acf_rack/init.lua | 3 +-- lua/entities/acf_radar/init.lua | 2 +- lua/entities/acf_receiver/init.lua | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lua/acf/hooks/hooks_missiles_sv.lua b/lua/acf/hooks/hooks_missiles_sv.lua index 741f205c..7e157be0 100644 --- a/lua/acf/hooks/hooks_missiles_sv.lua +++ b/lua/acf/hooks/hooks_missiles_sv.lua @@ -11,7 +11,7 @@ Hooks.Add("ACF_Missiles_Server", function(Gamemode) --- @param Entity entity The affected missile. --- @param Data table The bullet data of the affected missile. --- @return boolean # True if the missile can explode, false otherwise. - function Gamemode:ACF_MissileCanExplode() + function Gamemode:ACF_PreExplodeMissile() return true end diff --git a/lua/acf/missiles/acfm_roundinject.lua b/lua/acf/missiles/acfm_roundinject.lua index 11b88b69..ff335719 100644 --- a/lua/acf/missiles/acfm_roundinject.lua +++ b/lua/acf/missiles/acfm_roundinject.lua @@ -163,7 +163,7 @@ else return Result end - hook.Add("ACF_VerifyData", "ACF Missile Ammo", function(EntClass, Data, ...) + hook.Add("ACF_OnVerifyData", "ACF Missile Ammo", function(EntClass, Data, ...) if not AllowedClass[EntClass] then return end if Data.Destiny ~= "Missiles" then return end diff --git a/lua/entities/acf_computer/init.lua b/lua/entities/acf_computer/init.lua index dfc4a97a..e054f98b 100644 --- a/lua/entities/acf_computer/init.lua +++ b/lua/entities/acf_computer/init.lua @@ -117,7 +117,7 @@ do -- Spawn and update function Class.VerifyData(Data, Class) end - hook.Run("ACF_VerifyData", "acf_computer", Data, Class) + hook.Run("ACF_OnVerifyData", "acf_computer", Data, Class) end end diff --git a/lua/entities/acf_glatgm/init.lua b/lua/entities/acf_glatgm/init.lua index 3f86dcbd..6a2aa9d2 100644 --- a/lua/entities/acf_glatgm/init.lua +++ b/lua/entities/acf_glatgm/init.lua @@ -32,7 +32,7 @@ local function ClampAngle(Object, Limit) end local function DetonateMissile(Missile, Inflictor) - local CanExplode = hook.Run("ACF_MissileCanExplode", Missile, Missile.BulletData) + local CanExplode = hook.Run("ACF_PreExplodeMissile", Missile, Missile.BulletData) if not CanExplode then return end diff --git a/lua/entities/acf_missile/init.lua b/lua/entities/acf_missile/init.lua index e9fa7ee4..0a704c72 100644 --- a/lua/entities/acf_missile/init.lua +++ b/lua/entities/acf_missile/init.lua @@ -291,7 +291,7 @@ local function CalcFlight(Missile) end local function DetonateMissile(Missile, Inflictor) - local CanExplode = hook.Run("ACF_MissileCanExplode", Missile, Missile.BulletData) + local CanExplode = hook.Run("ACF_PreExplodeMissile", Missile, Missile.BulletData) if not CanExplode then return end diff --git a/lua/entities/acf_rack/init.lua b/lua/entities/acf_rack/init.lua index 94b922f6..7c2e03ae 100644 --- a/lua/entities/acf_rack/init.lua +++ b/lua/entities/acf_rack/init.lua @@ -6,7 +6,6 @@ include("shared.lua") -- Local Vars ----------------------------------- local EMPTY = { Type = "Empty", PropMass = 0, ProjMass = 0, Tracer = 0 } -local HookRun = hook.Run local ACF = ACF local Contraption = ACF.Contraption local Classes = ACF.Classes @@ -89,7 +88,7 @@ do -- Spawning and Updating -------------------- Rack.VerifyData(Data, Rack) end - hook.Run("ACF_VerifyData", "acf_rack", Data, Rack) + hook.Run("ACF_OnVerifyData", "acf_rack", Data, Rack) end end diff --git a/lua/entities/acf_radar/init.lua b/lua/entities/acf_radar/init.lua index 43c1685e..00e68b59 100644 --- a/lua/entities/acf_radar/init.lua +++ b/lua/entities/acf_radar/init.lua @@ -325,7 +325,7 @@ do -- Spawn and Update functions Class.VerifyData(Data, Class) end - hook.Run("ACF_VerifyData", "acf_radar", Data, Class) + hook.Run("ACF_OnVerifyData", "acf_radar", Data, Class) end end diff --git a/lua/entities/acf_receiver/init.lua b/lua/entities/acf_receiver/init.lua index 6f2591d7..1f1f5704 100644 --- a/lua/entities/acf_receiver/init.lua +++ b/lua/entities/acf_receiver/init.lua @@ -124,7 +124,7 @@ do -- Spawn and Update functions Class.VerifyData(Data, Class) end - hook.Run("ACF_VerifyData", "acf_receiver", Data, Class) + hook.Run("ACF_OnVerifyData", "acf_receiver", Data, Class) end end From d57b9a1b24d6c26969c91fdda3e880248517dc1d Mon Sep 17 00:00:00 2001 From: thecraftianman <64441307+thecraftianman@users.noreply.github.com> Date: Tue, 14 Jan 2025 22:47:42 -0500 Subject: [PATCH 11/12] One more hook naming pass ACF_OnMissileLaunched -> ACF_OnLaunchMissile --- lua/acf/core/laser/laser_sv.lua | 2 +- lua/acf/entities/ammo_types/flare.lua | 2 +- lua/acf/entities/components/computers.lua | 2 +- lua/acf/hooks/hooks_missiles_sv.lua | 3 ++- lua/acf/menu/items_cl/missiles.lua | 2 +- lua/entities/acf_computer/init.lua | 4 ++-- lua/entities/acf_glatgm/init.lua | 2 +- lua/entities/acf_missile/init.lua | 6 +++--- lua/entities/acf_rack/init.lua | 6 +++--- lua/entities/acf_radar/init.lua | 4 ++-- lua/entities/acf_receiver/init.lua | 4 ++-- 11 files changed, 19 insertions(+), 18 deletions(-) diff --git a/lua/acf/core/laser/laser_sv.lua b/lua/acf/core/laser/laser_sv.lua index 030a164f..b9d7c475 100644 --- a/lua/acf/core/laser/laser_sv.lua +++ b/lua/acf/core/laser/laser_sv.lua @@ -59,6 +59,6 @@ hook.Add("ACF_OnLoadPlayer", "ACF Laser Setup", function(Player) net.Send(Player) end) -hook.Add("ACF_OnMissileLaunched", "ACF Laser Filter Update", function(Missile) +hook.Add("ACF_OnLaunchMissile", "ACF Laser Filter Update", function(Missile) ACF.FilterLaserEntity(Missile) end) diff --git a/lua/acf/entities/ammo_types/flare.lua b/lua/acf/entities/ammo_types/flare.lua index 1213bc2f..c63096eb 100644 --- a/lua/acf/entities/ammo_types/flare.lua +++ b/lua/acf/entities/ammo_types/flare.lua @@ -21,7 +21,7 @@ function Ammo:GetDisplayData(Data) BurnTime = Data.BurnTime, } - hook.Run("ACF_OnGetDisplayData", self, Data, Display) + hook.Run("ACF_OnRequestDisplayData", self, Data, Display) return Display end diff --git a/lua/acf/entities/components/computers.lua b/lua/acf/entities/components/computers.lua index 545af550..1ebbad0c 100644 --- a/lua/acf/entities/components/computers.lua +++ b/lua/acf/entities/components/computers.lua @@ -266,7 +266,7 @@ do -- Optical guidance computer return math.floor(Value * 0.00254) * 393.7 end - hook.Add("ACF_OnMissileLaunched", "ACF Optical Computer Filter", function(Missile) + hook.Add("ACF_OnLaunchMissile", "ACF Optical Computer Filter", function(Missile) for Computer in pairs(Computers) do local Filter = Computer.Filter diff --git a/lua/acf/hooks/hooks_missiles_sv.lua b/lua/acf/hooks/hooks_missiles_sv.lua index 7e157be0..e252f3a3 100644 --- a/lua/acf/hooks/hooks_missiles_sv.lua +++ b/lua/acf/hooks/hooks_missiles_sv.lua @@ -4,7 +4,7 @@ local Hooks = ACF.Utilities.Hooks Hooks.Add("ACF_Missiles_Server", function(Gamemode) --- Called after a missile is fired. --- @param Entity entity The missile entity that was launched. - function Gamemode:ACF_OnMissileLaunched() + function Gamemode:ACF_OnLaunchMissile() end --- Called when a missile attempts to create an explosion. @@ -17,6 +17,7 @@ Hooks.Add("ACF_Missiles_Server", function(Gamemode) --- Called when a missile plays its sound if the ACF Sound Extension Project by looterz is installed. --- This is a legacy hook from ACF-2 and may be removed at any time. + --- @deprecated --- @param Entity entity The missile entity to play sound on. --- @param Sound string The sound to play. function Gamemode:ACF_SOUND_MISSILE() diff --git a/lua/acf/menu/items_cl/missiles.lua b/lua/acf/menu/items_cl/missiles.lua index f319ffda..2f5bfac8 100644 --- a/lua/acf/menu/items_cl/missiles.lua +++ b/lua/acf/menu/items_cl/missiles.lua @@ -142,6 +142,6 @@ end ACF.AddMenuItem(101, "Entities", "Missiles", "wand", CreateMenu) -hook.Add("ACF_PreCreateTraceControls", "ACF Missiles Remove Tracer Checkbox", function(_, ToolData) +hook.Add("ACF_PreCreateTracerControls", "ACF Missiles Remove Tracer Checkbox", function(_, ToolData) if ToolData.PrimaryClass == "acf_rack" then return false end end) diff --git a/lua/entities/acf_computer/init.lua b/lua/entities/acf_computer/init.lua index e054f98b..94043035 100644 --- a/lua/entities/acf_computer/init.lua +++ b/lua/entities/acf_computer/init.lua @@ -225,7 +225,7 @@ do -- Spawn and update function Class.OnSpawn(Entity, Data, Class, Computer) end - hook.Run("ACF_OnEntitySpawn", "acf_computer", Entity, Data, Class, Computer) + hook.Run("ACF_OnSpawnEntity", "acf_computer", Entity, Data, Class, Computer) WireLib.TriggerOutput(Entity, "Entity", Entity) @@ -280,7 +280,7 @@ do -- Spawn and update function Class.OnUpdate(self, Data, Class, Computer) end - hook.Run("ACF_OnEntityUpdate", "acf_computer", self, Data, Class, Computer) + hook.Run("ACF_OnUpdateEntity", "acf_computer", self, Data, Class, Computer) self:UpdateOverlay(true) diff --git a/lua/entities/acf_glatgm/init.lua b/lua/entities/acf_glatgm/init.lua index 6a2aa9d2..ebb6c82e 100644 --- a/lua/entities/acf_glatgm/init.lua +++ b/lua/entities/acf_glatgm/init.lua @@ -117,7 +117,7 @@ function MakeACF_GLATGM(Gun, BulletData) Missiles[Entity] = true - hook.Run("ACF_OnMissileLaunched", Entity) + hook.Run("ACF_OnLaunchMissile", Entity) return Entity end diff --git a/lua/entities/acf_missile/init.lua b/lua/entities/acf_missile/init.lua index 0a704c72..4ca131fc 100644 --- a/lua/entities/acf_missile/init.lua +++ b/lua/entities/acf_missile/init.lua @@ -310,7 +310,7 @@ hook.Add("CanDrive", "acf_missile_CanDrive", function(_, Entity) if ActiveMissiles[Entity] then return false end end) -hook.Add("ACF_OnMissileLaunched", "ACF Missile Rack Filter", function(Missile) +hook.Add("ACF_OnLaunchMissile", "ACF Missile Rack Filter", function(Missile) local Count = #Missile.Filter for K in pairs(ActiveMissiles) do @@ -408,7 +408,7 @@ function MakeACF_Missile(Player, Pos, Ang, Rack, MountPoint, Crate) Missile.Inputs = WireLib.CreateInputs(Missile, Inputs) Missile.Outputs = WireLib.CreateOutputs(Missile, Outputs) - hook.Run("ACF_OnEntitySpawn", "acf_missile", Missile, Data, Class, Crate) + hook.Run("ACF_OnSpawnEntity", "acf_missile", Missile, Data, Class, Crate) WireLib.TriggerOutput(Missile, "Entity", Missile) @@ -549,7 +549,7 @@ function ENT:Launch(Delay, IsMisfire) UpdateBodygroups(self, "OnLaunch") UpdateSkin(self) - hook.Run("ACF_OnMissileLaunched", self) + hook.Run("ACF_OnLaunchMissile", self) end function ENT:DoFlight(ToPos, ToDir) diff --git a/lua/entities/acf_rack/init.lua b/lua/entities/acf_rack/init.lua index 7c2e03ae..f93f32de 100644 --- a/lua/entities/acf_rack/init.lua +++ b/lua/entities/acf_rack/init.lua @@ -215,7 +215,7 @@ do -- Spawning and Updating -------------------- RackData.OnSpawn(Rack, Data, RackData) end - hook.Run("ACF_OnEntitySpawn", "acf_rack", Rack, Data, RackData) + hook.Run("ACF_OnSpawnEntity", "acf_rack", Rack, Data, RackData) WireLib.TriggerOutput(Rack, "Rate of Fire", 60) WireLib.TriggerOutput(Rack, "Reload Time", 1) @@ -284,7 +284,7 @@ do -- Spawning and Updating -------------------- Rack.OnUpdate(self, Data, Rack) end - hook.Run("ACF_OnEntityUpdate", "acf_rack", self, Data, Rack) + hook.Run("ACF_OnUpdateEntity", "acf_rack", self, Data, Rack) local Crates = self.Crates @@ -551,7 +551,7 @@ do -- Firing ----------------------------------- function ENT:Shoot() local Index, Point = self:GetNextMountPoint("Loaded", self.PointIndex) local Delay = self.FireDelay - local CanFire = hook.Run("ACF_WeaponCanFire", self) + local CanFire = hook.Run("ACF_PreFireWeapon", self) if Index and CanFire then ShootMissile(self, Point) diff --git a/lua/entities/acf_radar/init.lua b/lua/entities/acf_radar/init.lua index b98964ac..0ed966b0 100644 --- a/lua/entities/acf_radar/init.lua +++ b/lua/entities/acf_radar/init.lua @@ -417,7 +417,7 @@ do -- Spawn and Update functions Class.OnSpawn(Radar, Data, Class, RadarData) end - hook.Run("ACF_OnEntitySpawn", "acf_radar", Radar, Data, Class, RadarData) + hook.Run("ACF_OnSpawnEntity", "acf_radar", Radar, Data, Class, RadarData) WireLib.TriggerOutput(Radar, "Entity", Radar) @@ -474,7 +474,7 @@ do -- Spawn and Update functions Class.OnUpdate(self, Data, Class, Radar) end - hook.Run("ACF_OnEntityUpdate", "acf_radar", self, Data, Class, Radar) + hook.Run("ACF_OnUpdateEntity", "acf_radar", self, Data, Class, Radar) self:UpdateOverlay(true) diff --git a/lua/entities/acf_receiver/init.lua b/lua/entities/acf_receiver/init.lua index 1f1f5704..ff4e3456 100644 --- a/lua/entities/acf_receiver/init.lua +++ b/lua/entities/acf_receiver/init.lua @@ -204,7 +204,7 @@ do -- Spawn and Update functions Class.OnSpawn(Receiver, Data, Class, ReceiverData) end - hook.Run("ACF_OnEntitySpawn", "acf_receiver", Receiver, Data, Class, ReceiverData) + hook.Run("ACF_OnSpawnEntity", "acf_receiver", Receiver, Data, Class, ReceiverData) WireLib.TriggerOutput(Receiver, "Entity", Receiver) @@ -252,7 +252,7 @@ do -- Spawn and Update functions Class.OnUpdate(self, Data, Class, Receiver) end - hook.Run("ACF_OnEntityUpdate", "acf_Receiver", self, Data, Class, Receiver) + hook.Run("ACF_OnUpdateEntity", "acf_Receiver", self, Data, Class, Receiver) self:UpdateOverlay(true) From 0ab12dca5ffd6239df80da6d96f79cad45b5c44c Mon Sep 17 00:00:00 2001 From: thecraftianman <64441307+thecraftianman@users.noreply.github.com> Date: Tue, 14 Jan 2025 22:50:08 -0500 Subject: [PATCH 12/12] Fix repo reference --- lua/acf/core/acfm_globals.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/acf/core/acfm_globals.lua b/lua/acf/core/acfm_globals.lua index f257451c..3042ad6e 100644 --- a/lua/acf/core/acfm_globals.lua +++ b/lua/acf/core/acfm_globals.lua @@ -16,7 +16,7 @@ PrecacheParticleSystem("ACFM_Flare") do -- Update checker hook.Add("ACF_OnLoadAddon", "ACF Missiles Update Checker", function() - ACF.AddRepository("TwistedTail", "ACF-3-Missiles", "lua/acf/core/acfm_globals.lua") + ACF.AddRepository("ACF-Team", "ACF-3-Missiles", "lua/acf/core/acfm_globals.lua") hook.Remove("ACF_OnLoadAddon", "ACF Missiles Update Checker") end)