Skip to content

Commit

Permalink
feat: delete karts when PIXEL UI isn't installed
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDotBat committed Jun 9, 2021
1 parent bf6d40f commit 062ea9f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/entities/pixel_kart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ AccessorFunc(ENT, "pPIXELKartOwner", "PIXELKartOwner")
function ENT:Initialize()
self:SetModel("models/freeman/vehicles/electric_go-kart.mdl")

if not PIXEL.UI then
SafeRemoveEntityDelayed(self, 0)
return
end

if CLIENT then return end

local owner = self:GetPIXELKartOwner()
Expand Down
6 changes: 6 additions & 0 deletions lua/entities/pixel_karts_repair_wrench.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ ENT.AdminOnly = false
if SERVER then
function ENT:Initialize()
self:SetModel("models/mark2580/gtav/garage_stuff/span_02.mdl")

if not PIXEL.UI then
SafeRemoveEntityDelayed(self, 0)
return
end

self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
Expand Down

0 comments on commit 062ea9f

Please sign in to comment.