diff --git a/lua/acf/contraption/contraption_sv.lua b/lua/acf/contraption/contraption_sv.lua index 01558235..8506e4c1 100644 --- a/lua/acf/contraption/contraption_sv.lua +++ b/lua/acf/contraption/contraption_sv.lua @@ -87,7 +87,7 @@ function Contraption.GetAllChildren(Ent, Tab) end function Contraption.GetEnts(Ent) - local Ancestor = Contraption.GetAncestor(Ent) + local Ancestor = Ent:GetAncestor() local Phys = Contraption.GetAllPhysicalEntities(Ancestor) local Pare = {} diff --git a/lua/acf/damage/ke_shove_sv.lua b/lua/acf/damage/ke_shove_sv.lua index dcae2f76..c4d5f5ed 100644 --- a/lua/acf/damage/ke_shove_sv.lua +++ b/lua/acf/damage/ke_shove_sv.lua @@ -9,7 +9,7 @@ function ACF.KEShove(Target, Pos, Vec, KE) if hook.Run("ACF_KEShove", Target, Pos, Vec, KE) == false then return end - local Ancestor = Contraption.GetAncestor(Target) + local Ancestor = Target:GetAncestor() local Phys = Ancestor:GetPhysicsObject() if IsValid(Phys) then diff --git a/lua/entities/acf_ammo/init.lua b/lua/entities/acf_ammo/init.lua index 91c4eddc..199c4d17 100644 --- a/lua/entities/acf_ammo/init.lua +++ b/lua/entities/acf_ammo/init.lua @@ -465,7 +465,7 @@ do -- ACF Activation and Damage ----------------- Sounds.SendSound(Entity, "ambient/explosions/explode_4.wav", 140, Pitch, 1) BulletData.Pos = Entity:LocalToWorld(Entity:OBBCenter() + VectorRand() * Entity:GetSize() * 0.5) -- Random position in the ammo crate - BulletData.Flight = VectorRand():GetNormalized() * Speed * 39.37 + Contraption.GetAncestor(Entity):GetVelocity() -- Random direction including baseplate speed + BulletData.Flight = VectorRand():GetNormalized() * Speed * 39.37 + Entity:GetAncestor():GetVelocity() -- Random direction including baseplate speed BulletData.Owner = Entity.Inflictor or Entity.Owner BulletData.Gun = Entity diff --git a/lua/entities/acf_gearbox/init.lua b/lua/entities/acf_gearbox/init.lua index ceeb61c3..72b50a19 100644 --- a/lua/entities/acf_gearbox/init.lua +++ b/lua/entities/acf_gearbox/init.lua @@ -760,7 +760,7 @@ do -- Movement ----------------------------------------- self.InGear = true end - local BoxPhys = Contraption.GetAncestor(self):GetPhysicsObject() + local BoxPhys = self:GetAncestor():GetPhysicsObject() local SelfWorld = BoxPhys:LocalToWorldVector(BoxPhys:GetAngleVelocity()) local Gear = self.Gear @@ -884,7 +884,7 @@ do -- Movement ----------------------------------------- end if ReactTq ~= 0 then - local BoxPhys = Contraption.GetAncestor(self):GetPhysicsObject() + local BoxPhys = self:GetAncestor():GetPhysicsObject() if IsValid(BoxPhys) then BoxPhys:ApplyTorqueCenter(self:GetRight() * Clamp(2 * deg(ReactTq * MassRatio) * DeltaTime, -500000, 500000)) @@ -896,8 +896,6 @@ do -- Movement ----------------------------------------- end ---------------------------------------------------- do -- Braking ------------------------------------------ - local Contraption = ACF.Contraption - local function BrakeWheel(Link, Wheel, Brake) local Phys = Wheel:GetPhysicsObject() local AntiSpazz = 1 @@ -924,7 +922,7 @@ do -- Braking ------------------------------------------ if not next(self.Wheels) then return end -- No brakes for the non-wheel users if self.LastBrake == Clock.CurTime then return end -- Don't run this twice in a tick - local BoxPhys = Contraption.GetAncestor(self):GetPhysicsObject() + local BoxPhys = self:GetAncestor():GetPhysicsObject() local SelfWorld = BoxPhys:LocalToWorldVector(BoxPhys:GetAngleVelocity()) local DeltaTime = Clock.DeltaTime diff --git a/lua/entities/acf_gun/init.lua b/lua/entities/acf_gun/init.lua index 9e8a3023..cb05c2d6 100644 --- a/lua/entities/acf_gun/init.lua +++ b/lua/entities/acf_gun/init.lua @@ -544,7 +544,7 @@ do -- Metamethods -------------------------------- local randUnitSquare = (self:GetUp() * (2 * math.random() - 1) + self:GetRight() * (2 * math.random() - 1)) local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (self:GetForward() + Spread):GetNormalized() - local Velocity = Contraption.GetAncestor(self):GetVelocity() + local Velocity = self:GetAncestor():GetVelocity() local BulletData = self.BulletData local AmmoType = AmmoTypes.Get(BulletData.Type)