Skip to content

Commit

Permalink
re-added hasMerged. Also added comment to prevent it from being remov…
Browse files Browse the repository at this point in the history
…ed in the future
  • Loading branch information
FPtje committed Jan 31, 2014
1 parent 020666e commit a94e084
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion entities/entities/darkrp_cheque/init.lua
Expand Up @@ -42,11 +42,13 @@ end

function ENT:Touch(ent)
-- the .USED var is also used in other mods for the same purpose
if ent:GetClass() ~= "darkrp_cheque" or self.USED or ent.USED then return end
if ent:GetClass() ~= "darkrp_cheque" or self.USED or ent.USED or self.hasMerged or ent.hasMerged then return end
if ent.dt.owning_ent ~= self.dt.owning_ent then return end
if ent.dt.recipient ~= self.dt.recipient then return end

-- Both hasMerged and USED are used by third party mods. Keep both in.
ent.USED = true
ent.hasMerged = true

ent:Remove()
self:Setamount(self:Getamount() + ent:Getamount())
Expand Down
4 changes: 3 additions & 1 deletion entities/entities/spawned_money/init.lua
Expand Up @@ -28,9 +28,11 @@ end

function ENT:Touch(ent)
-- the .USED var is also used in other mods for the same purpose
if ent:GetClass() ~= "spawned_money" or self.USED or ent.USED then return end
if ent:GetClass() ~= "spawned_money" or self.USED or ent.USED or self.hasMerged or ent.hasMerged then return end

-- Both hasMerged and USED are used by third party mods. Keep both in.
ent.USED = true
ent.hasMerged = true

ent:Remove()
self:Setamount(self:Getamount() + ent:Getamount())
Expand Down
5 changes: 4 additions & 1 deletion entities/entities/spawned_shipment/init.lua
Expand Up @@ -166,8 +166,11 @@ function ENT:Touch(ent)
if ent:GetClass() ~= "spawned_shipment" or
self:Getcontents() ~= ent:Getcontents() or
self.locked or ent.locked or
self.USED or ent.USED then return end
self.USED or ent.USED or
self.hasMerged or ent.hasMerged then return end

-- Both hasMerged and USED are used by third party mods. Keep both in.
ent.hasMerged = true
ent.USED = true

local selfCount, entCount = self:Getcount(), ent:Getcount()
Expand Down

0 comments on commit a94e084

Please sign in to comment.