Skip to content

Commit

Permalink
fix: ignore invalid vehicles in the spawner function.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshPiper committed Jan 16, 2025
1 parent 2457b1a commit da7002f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/autorun/photon/sh_photon_vehicles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function Photon:EntityCreated( ent )
if ent:IsVehicle() then
local timerId = ent:EntIndex() .. "-PHOTON-" .. CurTime()
timer.Create( timerId, .01, 10, function()
if not IsValid(ent) then
return
end
if ent.VehicleTable and istable(ent.VehicleTable) then
Photon:SpawnedVehicle( ent )
EMVU:SpawnedVehicle( ent )
Expand Down

0 comments on commit da7002f

Please sign in to comment.