From 9181811b28c5f0edbb12b8bb69954eb7d56d6a9e Mon Sep 17 00:00:00 2001 From: thecraftianman <64441307+thecraftianman@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:38:09 -0500 Subject: [PATCH] Hopefully better seat compatibility check? So far every mod that's been broken by this creates seats without a .VehicleTable, and every seat we want to check seems to have one. This still might not be a foolproof solution, though. --- lua/acf/contraption/seats_sv.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/acf/contraption/seats_sv.lua b/lua/acf/contraption/seats_sv.lua index 156fa968f..4ffe0303b 100644 --- a/lua/acf/contraption/seats_sv.lua +++ b/lua/acf/contraption/seats_sv.lua @@ -4,8 +4,7 @@ hook.Add("OnEntityCreated", "ACF_SeatLegality", function(Entity) timer.Simple(0, function() if not IsValid(Entity) then return end if Entity:GetClass() ~= "prop_vehicle_prisoner_pod" then return end - if Entity.fphysSeat then return end -- simfphys vehicles will make non-solid seats that should be ignored - if Entity.wac_ignore then return end -- WAC vehicles do this too + if not Entity.VehicleTable then return end -- Some vehicles like simfphys/WAC/Sit Anywhere will make non-solid seats that should be ignored local PhysObj = Entity:GetPhysicsObject() if not IsValid(PhysObj) then return end @@ -15,7 +14,7 @@ hook.Add("OnEntityCreated", "ACF_SeatLegality", function(Entity) Entity.ACF.LegalMass = PhysObj:GetMass() Entity.ACF.Model = Entity:GetModel() Entity.ACF.LegalSeat = true - Entity.WireDebugName = Entity.WireDebugName or (Entity.VehicleTable and Entity.VehicleTable.Name) or "ACF Legal Vehicle" + Entity.WireDebugName = Entity.WireDebugName or Entity.VehicleTable.Name or "ACF Legal Vehicle" Entity.Enable = function() Entity.ACF.LegalSeat = true