@@ -392,6 +392,7 @@ function ENT:SpawnCSEnt(k,override)
392
392
local model = v .model
393
393
if v .modelcallback then model = v .modelcallback (self ) or v .model end
394
394
local cent = ClientsideModel (model ,RENDERGROUP_OPAQUE )
395
+ if not IsValid (cent ) then return false end
395
396
cent .GetBodyColor = function ()
396
397
if not IsValid (self ) then return Vector (1 ) end
397
398
return self :GetBodyColor ()
@@ -1346,6 +1347,7 @@ function ENT:Think()
1346
1347
for i ,v in ipairs (self .LeftDoorPositions ) do
1347
1348
if self :GetPackedBool (" DoorLS" .. i ) and not IsValid (stucked [i ]) then
1348
1349
local ent = ClientsideModel (table .Random (self .PassengerModels ),RENDERGROUP_OPAQUE )
1350
+ if not IsValid (ent ) then break end
1349
1351
ent :SetPos (self :LocalToWorld (Vector (v .x ,v .y ,self :GetStandingArea ().z )))
1350
1352
ent :SetAngles (self :LocalToWorldAngles (Angle (0 ,v .y < 0 and - 90 or 90 ,0 )))
1351
1353
ent :SetSkin (math.floor (ent :SkinCount ()* math.random ()))
@@ -1368,6 +1370,7 @@ function ENT:Think()
1368
1370
for i ,v in ipairs (self .RightDoorPositions ) do
1369
1371
if self :GetPackedBool (" DoorRS" .. i ) and not IsValid (stucked [- i ]) then
1370
1372
local ent = ClientsideModel (table .Random (self .PassengerModels ),RENDERGROUP_OPAQUE )
1373
+ if not IsValid (ent ) then break end
1371
1374
ent :SetPos (self :LocalToWorld (Vector (v .x ,v .y ,self :GetStandingArea ().z )))
1372
1375
ent :SetAngles (self :LocalToWorldAngles (Angle (0 ,v .y < 0 and - 90 or 90 ,0 )))
1373
1376
ent :SetSkin (math.floor (ent :SkinCount ()* math.random ()))
@@ -1403,6 +1406,7 @@ function ENT:Think()
1403
1406
-- local ent = ents.CreateClientProp("models/metrostroi/81-717/reverser.mdl")
1404
1407
-- ent:SetModel(table.Random(self.PassengerModels))
1405
1408
local ent = ClientsideModel (table .Random (self .PassengerModels ),RENDERGROUP_OPAQUE )
1409
+ if not IsValid (ent ) then break end
1406
1410
ent :SetPos (self :LocalToWorld (pos ))
1407
1411
ent :SetAngles (Angle (0 ,math.random (0 ,360 ),0 ))
1408
1412
--[[
0 commit comments