Skip to content

Commit

Permalink
feat: move door buy code for gamemode abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDotBat committed May 26, 2021
1 parent 7891d8d commit 36ff800
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/entities/pixel_kart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function ENT:Initialize()
veh:SetNWBool("PIXEL.Karts.IsKart", true)
veh:SetNWString("PIXEL.Karts.KartID", ownerId)

veh:keysOwn(owner)
PIXEL.Karts.KeysOwn(owner, veh)

veh:CPPISetOwner(owner)
veh.PIXELKartID = ownerId

Expand Down
4 changes: 4 additions & 0 deletions lua/pixelkarts/_config/sh_gamemode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ end

function PIXEL.Karts.CanAfford(ply, amount) --This is called when we want to check if a player can afford something
return ply:canAfford(amount)
end

function PIXEL.Karts.KeysOwn(ply, door) --This is called when we want to set a door's owner
return door:keysOwn(ply)
end

0 comments on commit 36ff800

Please sign in to comment.