Skip to content

Commit

Permalink
Ignore WAC seats in legal checks
Browse files Browse the repository at this point in the history
Is there a better way to ensure compatibility with other addons while still preventing arbitrary vehicles from being used to avoid the legal checks? Idk
  • Loading branch information
thecraftianman committed Jan 13, 2024
1 parent e6d084a commit b72f40c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/acf/contraption/seats_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ hook.Add("OnEntityCreated", "ACF_SeatLegality", function(Entity)
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

local PhysObj = Entity:GetPhysicsObject()
if not IsValid(PhysObj) then return end
Expand Down Expand Up @@ -38,7 +39,7 @@ hook.Add("CanPlayerEnterVehicle", "ACF_SeatLegality", function(Player, Entity)
if not Entity.ACF then return end

if not Entity.ACF.LegalSeat then
ACF.SendNotify(Player, false, "Seat is not legal and is currently disabled.")
ACF.SendNotify(Player, false, "[ACF] Seat is not legal and is currently disabled.")
return false
end
end)

0 comments on commit b72f40c

Please sign in to comment.