diff --git a/lua/acf/core/acfm_globals.lua b/lua/acf/core/acfm_globals.lua index b09e3cfd..f257451c 100644 --- a/lua/acf/core/acfm_globals.lua +++ b/lua/acf/core/acfm_globals.lua @@ -15,9 +15,9 @@ game.AddParticles("particles/flares_fx.pcf") PrecacheParticleSystem("ACFM_Flare") do -- Update checker - hook.Add("ACF_OnLoadAddon", "ACF Missiles Checker", function() - ACF.AddRepository("ACF-Team", "ACF-3-Missiles", "lua/acf/core/acfm_globals.lua") + 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 Checker") + hook.Remove("ACF_OnLoadAddon", "ACF Missiles Update Checker") end) end \ No newline at end of file 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/laser/laser_sv.lua b/lua/acf/core/laser/laser_sv.lua index bf0eafcc..030a164f 100644 --- a/lua/acf/core/laser/laser_sv.lua +++ b/lua/acf/core/laser/laser_sv.lua @@ -53,12 +53,12 @@ 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) 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/core/utilities/entity_tracking_sv.lua b/lua/acf/core/utilities/entity_tracking_sv.lua index 2276eedb..ee98933e 100644 --- a/lua/acf/core/utilities/entity_tracking_sv.lua +++ b/lua/acf/core/utilities/entity_tracking_sv.lua @@ -95,7 +95,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 82f6a080..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 @@ -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 4f6e9ce5..91710c64 100644 --- a/lua/acf/entities/ammo_types/glatgm.lua +++ b/lua/acf/entities/ammo_types/glatgm.lua @@ -96,12 +96,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 @@ -123,7 +123,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") @@ -151,7 +151,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/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..7e157be0 --- /dev/null +++ b/lua/acf/hooks/hooks_missiles_sv.lua @@ -0,0 +1,24 @@ +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() + end + + --- Called when a missile attempts to create an explosion. + --- @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_PreExplodeMissile() + 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 entity The missile entity to play sound on. + --- @param Sound string The sound to play. + function Gamemode:ACF_SOUND_MISSILE() + end +end) 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_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) diff --git a/lua/acf/missiles/acfm_roundinject.lua b/lua/acf/missiles/acfm_roundinject.lua index c89e634e..ff335719 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") @@ -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 = { @@ -175,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 5d261373..e054f98b 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 Contraption = ACF.Contraption local Damage = ACF.Damage @@ -72,7 +73,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() @@ -117,7 +117,7 @@ do -- Spawn and update function Class.VerifyData(Data, Class) end - HookRun("ACF_VerifyData", "acf_computer", Data, Class) + hook.Run("ACF_OnVerifyData", "acf_computer", Data, Class) end end @@ -225,7 +225,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) @@ -268,7 +268,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) @@ -280,7 +280,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) @@ -371,7 +371,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 be7ddf19..6a2aa9d2 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_PreExplodeMissile", 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 337e2eea..0a704c72 100644 --- a/lua/entities/acf_missile/init.lua +++ b/lua/entities/acf_missile/init.lua @@ -18,7 +18,7 @@ local Damage = ACF.Damage local Debug = ACF.Debug 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]" } @@ -291,7 +291,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_PreExplodeMissile", Missile, Missile.BulletData) + + if not CanExplode then return end if IsValid(Inflictor) and Inflictor:IsPlayer() then Missile.Inflictor = Inflictor @@ -308,7 +310,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 @@ -406,7 +408,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) @@ -465,7 +467,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 @@ -547,7 +549,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 19d23029..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 - HookRun("ACF_VerifyData", "acf_rack", Data, Rack) + hook.Run("ACF_OnVerifyData", "acf_rack", Data, Rack) end end @@ -216,7 +215,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) @@ -273,7 +272,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) @@ -285,7 +284,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) local Crates = self.Crates @@ -552,8 +551,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 @@ -943,7 +943,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 2f51783b..00e68b59 100644 --- a/lua/entities/acf_radar/init.lua +++ b/lua/entities/acf_radar/init.lua @@ -51,7 +51,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) @@ -325,7 +325,7 @@ do -- Spawn and Update functions Class.VerifyData(Data, Class) end - HookRun("ACF_VerifyData", "acf_radar", Data, Class) + hook.Run("ACF_OnVerifyData", "acf_radar", Data, Class) end end @@ -417,7 +417,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) @@ -462,7 +462,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) @@ -474,7 +474,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) @@ -542,7 +542,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 cd8360bd..1f1f5704 100644 --- a/lua/entities/acf_receiver/init.lua +++ b/lua/entities/acf_receiver/init.lua @@ -17,7 +17,7 @@ local Sounds = ACF.Utilities.Sounds 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 @@ -124,7 +124,7 @@ do -- Spawn and Update functions Class.VerifyData(Data, Class) end - HookRun("ACF_VerifyData", "acf_receiver", Data, Class) + hook.Run("ACF_OnVerifyData", "acf_receiver", Data, Class) end end @@ -204,7 +204,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) @@ -240,7 +240,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) @@ -252,7 +252,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) @@ -327,7 +327,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)