From 511a2e31998cbb8a47d50ebb61e6fc868ed104e7 Mon Sep 17 00:00:00 2001 From: Matt Stevens Date: Sat, 29 Sep 2018 11:49:25 +0100 Subject: [PATCH] #287 Fix for issue with trails not being removed on death --- lua/pointshop/items/trails/electric.lua | 1 + lua/pointshop/items/trails/laser.lua | 1 + lua/pointshop/items/trails/loltrail.lua | 1 + lua/pointshop/items/trails/lovetrail.lua | 1 + lua/pointshop/items/trails/plasmatrail.lua | 1 + lua/pointshop/items/trails/smoke.lua | 1 + lua/pointshop/items/trails/tube.lua | 1 + 7 files changed, 7 insertions(+) diff --git a/lua/pointshop/items/trails/electric.lua b/lua/pointshop/items/trails/electric.lua index 051c3cd..c43f848 100644 --- a/lua/pointshop/items/trails/electric.lua +++ b/lua/pointshop/items/trails/electric.lua @@ -3,6 +3,7 @@ ITEM.Price = 150 ITEM.Material = 'trails/electric.vmt' function ITEM:OnEquip(ply, modifications) + SafeRemoveEntity(ply.ElectricTrail) ply.ElectricTrail = util.SpriteTrail(ply, 0, modifications.color, false, 15, 1, 4, 0.125, self.Material) end diff --git a/lua/pointshop/items/trails/laser.lua b/lua/pointshop/items/trails/laser.lua index d14e24a..6e134a8 100644 --- a/lua/pointshop/items/trails/laser.lua +++ b/lua/pointshop/items/trails/laser.lua @@ -3,6 +3,7 @@ ITEM.Price = 150 ITEM.Material = 'trails/laser.vmt' function ITEM:OnEquip(ply, modifications) + SafeRemoveEntity(ply.LaserTrail) ply.LaserTrail = util.SpriteTrail(ply, 0, modifications.color, false, 15, 1, 4, 0.125, self.Material) end diff --git a/lua/pointshop/items/trails/loltrail.lua b/lua/pointshop/items/trails/loltrail.lua index faed8ed..f4f9193 100644 --- a/lua/pointshop/items/trails/loltrail.lua +++ b/lua/pointshop/items/trails/loltrail.lua @@ -3,6 +3,7 @@ ITEM.Price = 150 ITEM.Material = 'trails/lol.vmt' function ITEM:OnEquip(ply, modifications) + SafeRemoveEntity(ply.LolTrail) ply.LolTrail = util.SpriteTrail(ply, 0, modifications.color, false, 15, 1, 4, 0.125, self.Material) end diff --git a/lua/pointshop/items/trails/lovetrail.lua b/lua/pointshop/items/trails/lovetrail.lua index bf0c873..5659db7 100644 --- a/lua/pointshop/items/trails/lovetrail.lua +++ b/lua/pointshop/items/trails/lovetrail.lua @@ -3,6 +3,7 @@ ITEM.Price = 150 ITEM.Material = 'trails/love.vmt' function ITEM:OnEquip(ply, modifications) + SafeRemoveEntity(ply.LoveTrail) ply.LoveTrail = util.SpriteTrail(ply, 0, modifications.color, false, 15, 1, 4, 0.125, self.Material) end diff --git a/lua/pointshop/items/trails/plasmatrail.lua b/lua/pointshop/items/trails/plasmatrail.lua index aa6569a..8bfecd1 100644 --- a/lua/pointshop/items/trails/plasmatrail.lua +++ b/lua/pointshop/items/trails/plasmatrail.lua @@ -3,6 +3,7 @@ ITEM.Price = 150 ITEM.Material = 'trails/plasma.vmt' function ITEM:OnEquip(ply, modifications) + SafeRemoveEntity(ply.PlasmaTrail) ply.PlasmaTrail = util.SpriteTrail(ply, 0, modifications.color, false, 15, 1, 4, 0.125, self.Material) end diff --git a/lua/pointshop/items/trails/smoke.lua b/lua/pointshop/items/trails/smoke.lua index 99f3a8d..ac2648a 100644 --- a/lua/pointshop/items/trails/smoke.lua +++ b/lua/pointshop/items/trails/smoke.lua @@ -3,6 +3,7 @@ ITEM.Price = 150 ITEM.Material = 'trails/smoke.vmt' function ITEM:OnEquip(ply, modifications) + SafeRemoveEntity(ply.SmokeTrail) ply.SmokeTrail = util.SpriteTrail(ply, 0, modifications.color, false, 15, 1, 4, 0.125, self.Material) end diff --git a/lua/pointshop/items/trails/tube.lua b/lua/pointshop/items/trails/tube.lua index f6cbd56..f7520f9 100644 --- a/lua/pointshop/items/trails/tube.lua +++ b/lua/pointshop/items/trails/tube.lua @@ -3,6 +3,7 @@ ITEM.Price = 150 ITEM.Material = 'trails/tube.vmt' function ITEM:OnEquip(ply, modifications) + SafeRemoveEntity(ply.TubeTrail) ply.TubeTrail = util.SpriteTrail(ply, 0, modifications.color, false, 15, 1, 4, 0.125, self.Material) end