From 431447f42f8a5522ff145792f3ded499017c91c7 Mon Sep 17 00:00:00 2001 From: icedream Date: Fri, 24 Apr 2015 20:55:12 +0200 Subject: [PATCH] Only add taunts to the menu if they actually exist. --- lua/autorun/server/prophunt_tauntmenu.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/autorun/server/prophunt_tauntmenu.lua b/lua/autorun/server/prophunt_tauntmenu.lua index 518e325..00241cf 100644 --- a/lua/autorun/server/prophunt_tauntmenu.lua +++ b/lua/autorun/server/prophunt_tauntmenu.lua @@ -165,13 +165,17 @@ hook.Add("Think", "TauntList_DetectUpdate", function() tauntsTable[TEAM_HUNTERS] = GAMEMODE.Hunter_Taunts tauntsFixedTable[TEAM_HUNTERS] = {} for index, item in pairs(GAMEMODE.Hunter_Taunts) do - tauntsFixedTable[TEAM_HUNTERS][index] = { item[1], FixName(item[2]) } + if file.Exists(item[1], "GAME") then + tauntsFixedTable[TEAM_HUNTERS][index] = { item[1], FixName(item[2]) } + end end tauntsTable[TEAM_PROPS] = GAMEMODE.Prop_Taunts tauntsFixedTable[TEAM_PROPS] = {} for index, item in pairs(GAMEMODE.Prop_Taunts) do - tauntsFixedTable[TEAM_PROPS][index] = { item[1], FixName(item[2]) } + if file.Exists(item[1], "GAME") then + tauntsFixedTable[TEAM_PROPS][index] = { item[1], FixName(item[2]) } + end end -- Tables that hold sound paths, see Prop Hunt, sh_config.lua:70-168