Skip to content

Commit

Permalink
Potential fix for gProtect issues
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDotBat committed Jun 10, 2020
1 parent d3e219c commit 75dbbd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/entities/glorifiedbanking_cardreader/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end

--Merchant setter, use in a hook when buying entities if the merchant isn't setting
function ENT:SetMerchant(ply)
return GlorifiedBanking.SetEntOwner(self)
return GlorifiedBanking.SetEntOwner(self, ply)
end

--OnTransfer can be overriden to get data about transfers when complete
Expand Down
6 changes: 5 additions & 1 deletion lua/glorifiedbanking/sh_glorifiedbanking_compatibility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if SERVER then
DarkRP.notify( ply, msgType, time, message )
end

function GlorifiedBanking.SetEntOwner( ent )
function GlorifiedBanking.SetEntOwner( ent, ply )
if ent.Setowning_ent then ent:Setowning_ent(ply) end
ent:CPPISetOwner(ply)
end
Expand All @@ -37,3 +37,7 @@ else
notification.AddLegacy( message, msgType, time )
end
end

hook.Add("playerBoughtCustomEntity", "GlorifiedBanking.Compatability.playerBoughtCustomEntity", function(ply, entTbl, ent, price)
if ent:GetClass() == "glorifiedbanking_cardreader" then ent:SetMerchant(ply) end
end)

0 comments on commit 75dbbd5

Please sign in to comment.