Permalink
Browse files

Fixed spawnmenu_reload duplicating spawnlists

After changing spawnlists
  • Loading branch information...
1 parent 6839317 commit 1baf0c452b1b59a8401e314fdb0553caa26a2046 @robotboy655 robotboy655 committed May 4, 2016
Showing with 4 additions and 25 deletions.
  1. +4 −25 garrysmod/lua/includes/modules/spawnmenu.lua
@@ -1,13 +1,8 @@
local spawnmenu_engine = spawnmenu
---[[---------------------------------------------------------
-
------------------------------------------------------------]]
-
module( "spawnmenu", package.seeall )
-
local g_ToolMenu = {}
local CreationMenus = {}
local PropTable = {}
@@ -60,29 +55,16 @@ function GetToolMenu( name, label, icon )
end
-
---[[---------------------------------------------------------
-
------------------------------------------------------------]]
function ClearToolMenus()
g_ToolMenu = {}
end
-
---[[---------------------------------------------------------
-
------------------------------------------------------------]]
function AddToolTab( strName, strLabel, Icon )
GetToolMenu( strName, strLabel, Icon )
end
-
-
---[[---------------------------------------------------------
-
------------------------------------------------------------]]
function AddToolCategory( tab, RealName, PrintName )
local tab = GetToolMenu( tab )
@@ -99,9 +81,6 @@ function AddToolCategory( tab, RealName, PrintName )
end
---[[---------------------------------------------------------
-
------------------------------------------------------------]]
function AddToolMenuOption( tab, category, itemname, text, command, controls, cpanelfunction, TheTable )
local Menu = GetToolMenu( tab )
@@ -154,7 +133,6 @@ function GetCreationTabs()
end
-
--[[---------------------------------------------------------
GetPropTable
-----------------------------------------------------------]]
@@ -190,6 +168,10 @@ end
-----------------------------------------------------------]]
function PopulateFromEngineTextFiles()
+ -- Reset the already loaded prop list before loading them again.
+ -- This caused the spawnlists to duplicate into crazy trees when spawnmenu_reload'ing after saving edited spawnlists
+ PropTable = {}
+
spawnmenu_engine.PopulateFromTextFiles( AddPropCategory )
end
@@ -203,7 +185,6 @@ function DoSaveToTextFiles( props )
end
-
--[[
Content Providers
@@ -221,8 +202,6 @@ spawnmenu.AddContentType( "model", MyFunction )
--]]
-
-
local cp = {}
function AddContentType( name, func )

0 comments on commit 1baf0c4

Please sign in to comment.