diff options
| author | Scott <scotth0828@gmail.com> | 2016-05-21 17:43:47 -0400 |
|---|---|---|
| committer | Scott <scotth0828@gmail.com> | 2016-05-21 17:43:47 -0400 |
| commit | 10ed1a54523fdd5bcddfbccf44dd9c0a15ab8357 (patch) | |
| tree | dc40b8a399afea729a78fef6e3a92e7a41873b3d /gamemode | |
| parent | d73e78d8d98da223410f51f390549336554eb54d (diff) | |
| download | gmstranded-10ed1a54523fdd5bcddfbccf44dd9c0a15ab8357.tar.gz gmstranded-10ed1a54523fdd5bcddfbccf44dd9c0a15ab8357.tar.bz2 gmstranded-10ed1a54523fdd5bcddfbccf44dd9c0a15ab8357.zip | |
Fixed removing plants bug
Diffstat (limited to 'gamemode')
| -rw-r--r-- | gamemode/client/cl_quickmenu.lua | 2 | ||||
| -rw-r--r-- | gamemode/init.lua | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gamemode/client/cl_quickmenu.lua b/gamemode/client/cl_quickmenu.lua index c56c675..d2c1961 100644 --- a/gamemode/client/cl_quickmenu.lua +++ b/gamemode/client/cl_quickmenu.lua @@ -10,7 +10,9 @@ function GM:OnContextMenuOpen() -- Derma Menu self.Think = function() + if !cMenuOpen then return end + //print(LocalPlayer():GetEyeTrace().Entity:GetClass()) if (input.IsMouseDown(MOUSE_RIGHT)) then local tr = LocalPlayer():GetEyeTrace().Entity diff --git a/gamemode/init.lua b/gamemode/init.lua index 468dba1..85d2a56 100644 --- a/gamemode/init.lua +++ b/gamemode/init.lua @@ -67,6 +67,13 @@ util.AddNetworkString('giveres') net.Receive('removeEntity', function(len, ply) local ent = net.ReadEntity() + if (ent:GetClass() == "gms_generic_plantable") then ply:SetNWInt( "plants", ply:GetNWInt( "plants" ) - 1 ) end + if ent.IsPlantChild then + + local plant = ent.PlantParent + if (plant.Children <= 1) then plant:Fadeout() end + + end ent:Remove() end) |
