Skip to content

Commit

Permalink
Fixed spawnmenu_reload duplicating spawnlists
Browse files Browse the repository at this point in the history
After changing spawnlists
  • Loading branch information
robotboy655 committed May 4, 2016
1 parent 6839317 commit 1baf0c4
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions 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 = {}
Expand Down Expand Up @@ -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 )
Expand All @@ -99,9 +81,6 @@ function AddToolCategory( tab, RealName, PrintName )
end
--[[---------------------------------------------------------
-----------------------------------------------------------]]
function AddToolMenuOption( tab, category, itemname, text, command, controls, cpanelfunction, TheTable )
local Menu = GetToolMenu( tab )
Expand Down Expand Up @@ -154,7 +133,6 @@ function GetCreationTabs()
end
--[[---------------------------------------------------------
GetPropTable
-----------------------------------------------------------]]
Expand Down Expand Up @@ -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
Expand All @@ -203,7 +185,6 @@ function DoSaveToTextFiles( props )
end
--[[
Content Providers
Expand All @@ -221,8 +202,6 @@ spawnmenu.AddContentType( "model", MyFunction )
--]]
local cp = {}
function AddContentType( name, func )
Expand Down

0 comments on commit 1baf0c4

Please sign in to comment.