summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-04-16 22:30:18 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-04-16 22:30:18 -0400
commitc3bec1047513b8c19eb24fef5f3230486dd17cbd (patch)
tree1e20bdf27b743ad4c10553060ac538967f780d41
parentb16a5f74fc68b34c42c4c201a3f3e1030928bc81 (diff)
downloadgmstranded-c3bec1047513b8c19eb24fef5f3230486dd17cbd.tar.gz
gmstranded-c3bec1047513b8c19eb24fef5f3230486dd17cbd.tar.bz2
gmstranded-c3bec1047513b8c19eb24fef5f3230486dd17cbd.zip
Fixed most recepies not showing up in the structures menu
-rw-r--r--gamemode/cl_init.lua18
-rw-r--r--gamemode/cl_panels.lua42
-rw-r--r--gamemode/craftablesystem/loadcraftables.lua6
-rw-r--r--gamemode/init.lua14
-rw-r--r--gamemode/processes.lua46
-rw-r--r--gamemode/shared.lua46
-rw-r--r--gamemode/utility.lua10
7 files changed, 123 insertions, 59 deletions
diff --git a/gamemode/cl_init.lua b/gamemode/cl_init.lua
index bbf57a5..94a8051 100644
--- a/gamemode/cl_init.lua
+++ b/gamemode/cl_init.lua
@@ -7,7 +7,10 @@ include( "cl_panels.lua" )
include( "cl_hud.lua" )
include( "cl_deathmenu.lua" )
--- HUD Theme
+include( "utility.lua")
+includeFolder("craftablesystem",true)
+
+-- HUD Theme
StrandedColorTheme = Color( 0, 0, 0, 240 )
StrandedBorderTheme = Color( 0, 0, 0, 180 )
@@ -83,7 +86,7 @@ HintsRus = {
"Храните Вашу еду в холодильнике, чтобы она не портилась.",
"Чтобы племя могло использовать вещи друг друга, это племя должно иметь пароль.",
"Чтобы использовать фонарь, Вам нужно его сделать.",
- "Чем больше у Вас батареек, тем больше у Вас энергии для фонаря.",
+ "Чем больше у Вас батареек, тем больше у Вас энергии для фонаря.",
"Шанс поймать что-то без наживки ( Baits ) в 4 раза ниже, чем с наживкой.",
"Чтобы добыть железо ( Iron ) или медь ( Copper ) вам нужна кирка.",
"Проблемы? Прочтите !help для получения базовой информации об этом игровом режиме.",
@@ -310,6 +313,17 @@ usermessage.Hook( "gms_SetMaxResources", function( um )
end )
usermessage.Hook( "gms_OpenCombiMenu", function( um )
+
+ print("--------------In cl_init.lua's gms_OpenCombiMenu hook---------")
+ for k,v in pairs(GMS.Combinations) do
+ print("Recognize " .. k)
+ if(k == "Structures") then
+ for i,j in pairs(v) do
+ print("\tFound: " .. i)
+ end
+ end
+ end
+
if ( GAMEMODE.CombiMenu ) then GAMEMODE.CombiMenu:Remove() end
GAMEMODE.CombiMenu = vgui.Create( "GMS_CombinationWindow" )
GAMEMODE.CombiMenu:SetTable( um:ReadString() )
diff --git a/gamemode/cl_panels.lua b/gamemode/cl_panels.lua
index da01d3c..215f7d9 100644
--- a/gamemode/cl_panels.lua
+++ b/gamemode/cl_panels.lua
@@ -1,5 +1,5 @@
-surface.CreateFont( "DefaultBold", {
+surface.CreateFont( "DefaultBold", {
font = "Tahoma",
size = 16,
weight = 1000,
@@ -7,7 +7,7 @@ surface.CreateFont( "DefaultBold", {
additive = false
} )
-surface.CreateFont( "GMSUnlockDescription", {
+surface.CreateFont( "GMSUnlockDescription", {
font = "Tahoma",
size = 14,
weight = 500,
@@ -209,7 +209,7 @@ function PANEL:Paint()
surface.DrawLine( self:GetWide() - 1, 0, self:GetWide() - 1, self:GetTall() ) -- Nice line instead of messy outlined rect
surface.DrawLine( 0, self:GetTall() - 1, self:GetWide(), self:GetTall() - 1 )
surface.DrawLine( 0, 0, 0, self:GetTall() )
- if ( self.Extended ) then
+ if ( self.Extended ) then
surface.DrawLine( 0, 33, self:GetWide(), 33 )
end
@@ -236,8 +236,8 @@ function PANEL:RefreshSkills()
if ( !self.Extended ) then lbl:SetVisible( false ) end
end
- if ( self.Extended ) then
- self:SetSize( ScrW() / 6, 40 + ( table.Count( self.SkillLabels ) * 21 ) )
+ if ( self.Extended ) then
+ self:SetSize( ScrW() / 6, 40 + ( table.Count( self.SkillLabels ) * 21 ) )
end
end
@@ -351,9 +351,9 @@ function PANEL:RefreshResources()
if ( !self.Extended ) then lbl:SetVisible( false ) end
end
end
-
+
self.Line = self.Line + 21
-
+
local lblT = vgui.Create( "gms_ResourcePanelTotal", self )
lblT:SetPos( 0, self.Line )
lblT:SetSize( self:GetWide(), 16 )
@@ -362,10 +362,10 @@ function PANEL:RefreshResources()
table.insert( self.ResourceLabels, lblT )
if ( !self.Extended ) then lblT:SetVisible( false ) end
- if ( self.Extended ) then
- self:SetSize( ScrW() / 6, 40 + ( ( table.Count( self.ResourceLabels ) + 1 ) * 21 ) )
+ if ( self.Extended ) then
+ self:SetSize( ScrW() / 6, 40 + ( ( table.Count( self.ResourceLabels ) + 1 ) * 21 ) )
end
-
+
if ( GAMEMODE.CommandsHud ) then GAMEMODE.CommandsHud:SetPos( ScrW() / 6 + 2, self:GetTall() ) end
end
@@ -602,8 +602,8 @@ function PANEL:RefreshCommands()
local line7b = self:CreateButton( halfsize, self.Line, threesize, 16, "gms_tribes", "Join", Color( 200, 0, 200, 176 ) )
local line7c = self:CreateButton( halfsize + threesize, self.Line, threesize, 16, "gms_leave", "Leave", Color( 200, 0, 200, 176 ) )
- if ( self.Extended ) then
- self:SetSize( ScrW() / 6, 40 + ( self.Lines * 21 ) )
+ if ( self.Extended ) then
+ self:SetSize( ScrW() / 6, 40 + ( self.Lines * 21 ) )
end
end
@@ -848,9 +848,21 @@ function PANEL:Init()
end
function PANEL:SetTable( str )
+ --print("GMS.Combinations full:")
+ --PrintTable(GMS.Combinations)
+ print("----SetTable method-----")
+ for k,v in pairs(GMS.Combinations) do
+ print("Recognize " .. k)
+ if(k == "Structures") then
+ for i,j in pairs(v) do
+ print("\tFound: " .. i)
+ end
+ end
+ end
self:SetTitle( "#" .. str )
self.CombiGroupName = str
self.CombiGroup = GMS.Combinations[ str ]
+
self:Clear()
for name, tbl in SortedPairs( self.CombiGroup or {} ) do
local icon = vgui.Create( "GMS_CombiIcon", self.CombiList )
@@ -872,7 +884,7 @@ function PANEL:SetActive( combi, tbl )
if ( tbl.Req or tbl.SkillReq ) then
desc = desc .. "\n\nYou need:"
end
-
+
if ( tbl.Req and table.Count( tbl.Req ) > 0 ) then
for res, num in pairs( tbl.Req ) do
if ( tbl.AllSmelt ) then
@@ -898,7 +910,7 @@ end
function PANEL:ClearActive()
self.ActiveCombi = nil
- self.ActiveTable = nil
+ self.ActiveTable = nil
self.Info.NameLabel:SetText( "Select a recipe" )
self.Info.DescLabel:SetText( "" )
end
@@ -1155,4 +1167,4 @@ function PANEL:SetRes( str, num, isAll )
self.IsAll = isAll
end
-vgui.Register( "gms_StoreButton", PANEL, "DButton" ) \ No newline at end of file
+vgui.Register( "gms_StoreButton", PANEL, "DButton" )
diff --git a/gamemode/craftablesystem/loadcraftables.lua b/gamemode/craftablesystem/loadcraftables.lua
index 724401f..51b2e3e 100644
--- a/gamemode/craftablesystem/loadcraftables.lua
+++ b/gamemode/craftablesystem/loadcraftables.lua
@@ -3,6 +3,12 @@
GMS.Combinations = {}
function GMS.RegisterCombi( tbl, group )
if ( !GMS.Combinations[ group ] ) then GMS.Combinations[ group ] = {} end
+
+ if(group == "Structures") then
+ print("Found a structure:")
+ print(tbl.Name)
+ end
+
GMS.Combinations[ group ][ string.Replace( tbl.Name, " ", "_" ) ] = tbl
end
diff --git a/gamemode/init.lua b/gamemode/init.lua
index 57c2832..3605746 100644
--- a/gamemode/init.lua
+++ b/gamemode/init.lua
@@ -19,14 +19,23 @@ include( "processes.lua" )
include( "chatcommands.lua" )
-- include( "resources.lua" )
-GM.GAMEMODE_FOLDER_NAME = "gmstranded"
include( "utility.lua")
-print("About to include init_static.lua")
include( "init_static.lua")
AddCSLuaFolder("client",false)
+AddCSLuaFolder("craftablesystem",true)
includeFolder("server",false)
+print("-----Before includeing crafting system")
includeFolder("craftablesystem",true)
+print("-----After includeing crafting system")
+for k,v in pairs(GMS.Combinations) do
+ print("Recognize " .. k)
+ if(k == "Structures") then
+ for i,j in pairs(v) do
+ print("\tFound: " .. i)
+ end
+ end
+end
--Vars
GM.NextSaved = 0
@@ -41,6 +50,7 @@ GM.NextLoaded = 0
/* Moved to /server/tribes.lua*/
GM.AntlionBarrowSpawns = {}
+GM.TreeSpawns = {}
--GM.AntlionBarrowSpawns[ "gm_construct" ] = { Vector( -4321.8149, -2551.3449, 257.5130 ) }
local loadmaps = {"gm_construct","gms_rollinghills","gms_rollinghills_daynight","ggms_rollinghills_daynight_b1","gms_nowhere2","gms_minisurvival_v2","gms_coastal_outlands"}
for k,v in pairs(loadmaps) do
diff --git a/gamemode/processes.lua b/gamemode/processes.lua
index 468d03e..41ce61f 100644
--- a/gamemode/processes.lua
+++ b/gamemode/processes.lua
@@ -18,7 +18,7 @@ hook.Add( "Think", "gms_ProcessThinkHooks", function()
local basethink = v:BaseThink()
if ( think or basethink or IsStopped ) then
- if ( v.Owner and v.Owner != NULL and v.Owner:IsValid() ) then
+ if ( v.Owner and v.Owner != NULL and v.Owner:IsValid() ) then
v.Owner:Freeze( false )
v.Owner:StopProcessBar()
v.Owner.InProcess = false
@@ -90,7 +90,7 @@ function PlayerMeta:CancelProcess()
local v = self.ProcessTable
if ( !v.Cancel ) then return end
- if ( v.Owner and v.Owner != NULL and IsValid( v.Owner ) ) then
+ if ( v.Owner and v.Owner != NULL and IsValid( v.Owner ) ) then
v.Owner:Freeze( false )
v.Owner:StopProcessBar()
v.Owner.InProcess = false
@@ -183,8 +183,8 @@ function PROCESS:OnStop()
if ( self.SideGain ) then
local numto = 1
local numstart = 0
- if ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_woodenspoon" ) then
- numto = numto + 2
+ if ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_woodenspoon" ) then
+ numto = numto + 2
numstart = numstart + 1
end
local num = math.random( numstart, numto )
@@ -249,7 +249,7 @@ function PROCESS:OnStop()
elseif ( self.Owner.Hunger >= 900 ) then
self.Owner:SetFood( 1000 )
end
-
+
if ( self.Owner.Thirst <= 900 ) then
self.Owner:SetThirst( self.Owner.Thirst + 100 )
elseif ( self.Owner.Thirst >= 900 ) then
@@ -646,23 +646,23 @@ function PROCESS:OnStop()
local num2 = 1
if ( num < self.Data.Chance + self.Owner:GetSkill( "Mining" ) ) then
- if ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_stonepickaxe" ) then
+ if ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_stonepickaxe" ) then
num2 = math.random( 1, 2 )
- elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_copperpickaxe" ) then
+ elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_copperpickaxe" ) then
num2 = math.random( 1, 3 )
- elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_ironpickaxe" ) then
+ elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_ironpickaxe" ) then
num2 = math.random( 1, 4 )
- elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_techpickaxe" ) then
+ elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_techpickaxe" ) then
num2 = math.random( 1, 5 )
- elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_silverpickaxe" ) then
+ elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_silverpickaxe" ) then
num2 = math.random( 1, 6 )
- elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_goldpickaxe" ) then
+ elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_goldpickaxe" ) then
num2 = math.random( 1, 7 )
- elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_steelpickaxe" ) then
+ elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_steelpickaxe" ) then
num2 = math.random( 1, 8 )
- elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_platinumpickaxe" ) then
+ elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_platinumpickaxe" ) then
num2 = math.random( 1, 9 )
- elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_pickaxeofdjarex" ) then
+ elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_pickaxeofdjarex" ) then
num2 = math.random( 85, 85 )
elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_mithrilpickaxe" ) then
num2 = math.random( 1, 10 )
@@ -675,7 +675,7 @@ function PROCESS:OnStop()
elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_runewpickaxe" ) then
num2 = math.random( 1, 8 )
end
-
+
local num3 = math.random( self.Data.MinAmount, self.Data.MaxAmount )
@@ -703,7 +703,7 @@ function PROCESS:OnStop()
elseif ( num2 == 8 ) then
self.Owner:IncResource( "Platinum_Ore", num3 )
self.Owner:SendMessage( "Platinum Ore ( " .. num3 .. "x )", 3, Color( 10, 200, 10, 255 ) )
- elseif ( num2 == 85 ) then
+ elseif ( num2 == 85 ) then
self.Owner:IncResource( "Strange_Stone", num3 )
self.Owner:SendMessage( "Strange Stone ( " .. num3 .. "x ) ", 3, Color( 0, 247, 255, 255) )
elseif ( num2 == 9 ) then
@@ -712,7 +712,7 @@ function PROCESS:OnStop()
elseif ( num2 == 10) then
self.Owner:IncResource( "Adamantine_Ore", num3 )
self.Owner:SendMessage( "Adamantine Ore( " .. num3 .. "x ) ", 3, Color(255,0, 111, 255) )
- end
+ end
self.Owner:IncXP( "Mining", math.Clamp( math.Round( 50 / self.Owner:GetSkill( "Mining" ) ), 1, 1000 ) )
self.Owner:EmitSound( Sound( "items/ammo_pickup.wav" ) )
@@ -928,7 +928,7 @@ end
function PROCESS:OnStop()
local num = math.random( 1, 100 )
-
+
if ( !self.Owner.Resources['Baits'] or self.Owner.Resources['Baits'] < 1 ) then
self.Data.Chance = self.Data.Chance * 0.25
end
@@ -937,7 +937,7 @@ function PROCESS:OnStop()
if ( self.Owner.Resources['Baits'] and self.Owner.Resources['Baits'] > 0 ) then
self.Owner:DecResource( "Baits", 1 )
end
-
+
if ( num < ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 1.5 ) then
self.Owner:IncResource( "Bass", 1 )
self.Owner:SendMessage( "Bass ( 1x )", 3, Color( 10, 200, 10, 255 ) )
@@ -974,12 +974,12 @@ function PROCESS:OnStop()
if ( !self.Owner.Resources['Baits'] or self.Owner.Resources['Baits'] < 1 ) then
self.Data.Chance = self.Data.Chance * 0.25
end
-
+
if ( num < self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) then
if ( self.Owner.Resources['Baits'] and self.Owner.Resources['Baits'] > 0 ) then
self.Owner:DecResource( "Baits", 1 )
end
-
+
if ( num < ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 2 ) then
self.Owner:IncResource( "Bass", 1 )
self.Owner:SendMessage( "Bass ( 1x )", 3, Color( 10, 200, 10, 255 ) )
@@ -1068,7 +1068,7 @@ GMS.RegisterProcess( "DrinkBottle", PROCESS )
local PROCESS = {}
function PROCESS:OnStart()
- if ( self.Owner:Health() >= 200 or ( self.Owner:Health() >= 150 and self.Owner:HasUnlock( "Master_Survivalist" ) != true ) or ( self.Owner:Health() >= 100 and self.Owner:HasUnlock( "Adept_Survivalist" ) != true ) ) then
+ if ( self.Owner:Health() >= 200 or ( self.Owner:Health() >= 150 and self.Owner:HasUnlock( "Master_Survivalist" ) != true ) or ( self.Owner:Health() >= 100 and self.Owner:HasUnlock( "Adept_Survivalist" ) != true ) ) then
self.Owner:SendMessage( "You're feeling good, why would you heal yourself.", 3, Color( 200, 0, 0, 255 ) )
else
self.Owner:MakeProcessBar( "Taking Medicine", self.Time, self.Cancel )
@@ -1077,7 +1077,7 @@ function PROCESS:OnStart()
end
function PROCESS:OnStop()
- if ( self.Owner:Health() >= 200 or ( self.Owner:Health() >= 150 and self.Owner:HasUnlock( "Master_Survivalist" ) != true ) or ( self.Owner:Health() >= 100 and self.Owner:HasUnlock( "Adept_Survivalist" ) != true ) ) then return end
+ if ( self.Owner:Health() >= 200 or ( self.Owner:Health() >= 150 and self.Owner:HasUnlock( "Master_Survivalist" ) != true ) or ( self.Owner:Health() >= 100 and self.Owner:HasUnlock( "Adept_Survivalist" ) != true ) ) then return end
self.Owner:DecResource( "Medicine", 1 )
self.Owner:SendMessage( "You're feeling a bit better now.", 3, Color( 10, 200, 10, 255 ) )
self.Owner:Heal( 10 )
diff --git a/gamemode/shared.lua b/gamemode/shared.lua
index 77fd798..8b11b2c 100644
--- a/gamemode/shared.lua
+++ b/gamemode/shared.lua
@@ -6,8 +6,8 @@
READ THIS:
If you want to add custom content or edit anything in gamemode - DO NOT. Please read customcontent.lua!
- :
- - . customcontent.lua!
+ ������ ���:
+ ���� �� ����������� ��� ��� ���� �������� - �� ����� �����. ������ ���� customcontent.lua!
*/
DeriveGamemode( "sandbox" )
@@ -25,6 +25,20 @@ team.SetUp( 5, "The Dynamics", Color( 0, 72, 255, 255 ) )
team.SetUp( 6, "Scavengers", Color( 8, 255, 0, 255 ) )
GMS = GMS or {}
+GM.GAMEMODE_FOLDER_NAME = "gmstranded"
+
+include( "utility.lua")
+includeFolder("craftablesystem",true)
+print("-------In shared.lua--------")
+for k,v in pairs(GMS.Combinations) do
+ print("Recognize " .. k)
+ if(k == "Structures") then
+ for i,j in pairs(v) do
+ print("\tFound: " .. i)
+ end
+ end
+end
+
include( "spp/sh_spp.lua" )
include( "time_weather.lua" )
@@ -122,7 +136,7 @@ function EntityMeta:IsTreeModel()
end
-- Experemental
- if ( SERVER && string.find( self:GetModel(), "tree" ) && self:CreatedByMap() ) then return true end
+ if ( SERVER && string.find( self:GetModel(), "tree" ) && self:CreatedByMap() ) then return true end
return false
end
@@ -141,9 +155,9 @@ function EntityMeta:IsRockModel()
for k, v in pairs( GMS.AdditionalRockModels ) do
if ( string.lower( v ) == mdl or string.gsub( string.lower( v ), "/", "\\" ) == mdl ) then return true end
end
-
+
-- Experemental
- if ( SERVER && string.find( self:GetModel(), "rock" ) && self:CreatedByMap() ) then return true end
+ if ( SERVER && string.find( self:GetModel(), "rock" ) && self:CreatedByMap() ) then return true end
return false
end
@@ -219,29 +233,29 @@ function GM:PlayerNoClip( pl, on )
end
function GM:PhysgunPickup( ply, ent )
- if ( !IsValid( ent ) ) then return self.BaseClass.PhysgunPickup( self, ply, ent ) end
+ if ( !IsValid( ent ) ) then return self.BaseClass.PhysgunPickup( self, ply, ent ) end
if ( ent:IsRockModel() || ent:IsNPC() || ent:IsTreeModel() || ent:IsPlayer() || ent:IsFoodModel() || ent:IsPickupProhibitedModel() ) then return false end
-
+
if ( !SPropProtection.PhysGravGunPickup( ply, ent ) ) then return false end
-
+
return self.BaseClass.PhysgunPickup( self, ply, ent )
end
function GM:GravGunPunt( ply, ent )
- if ( !IsValid( ent ) ) then return self.BaseClass.GravGunPunt( self, ply, ent ) end
+ if ( !IsValid( ent ) ) then return self.BaseClass.GravGunPunt( self, ply, ent ) end
if ( ent:IsRockModel() || ent:IsNPC() || ent:IsTreeModel() || ent:IsPlayer() || ent:IsFoodModel() || ent:IsPickupProhibitedModel() || ent:GetClass() == "gms_buildsite" ) then return false end
-
+
if ( !SPropProtection.PhysGravGunPickup( ply, ent ) ) then return false end
-
+
return self.BaseClass.GravGunPunt( self, ply, ent )
end
function GM:GravGunPickupAllowed( ply, ent )
- if ( !IsValid( ent ) ) then return self.BaseClass.GravGunPickupAllowed( self, ply, ent ) end
+ if ( !IsValid( ent ) ) then return self.BaseClass.GravGunPickupAllowed( self, ply, ent ) end
if ( ent:IsRockModel() || ent:IsNPC() || ent:IsTreeModel() || ent:IsPlayer() || ent:IsFoodModel() || ent:IsPickupProhibitedModel() || ent:GetClass() == "gms_buildsite" ) then return false end
-
+
if ( !SPropProtection.PhysGravGunPickup( ply, ent ) ) then return false end
-
+
return self.BaseClass.GravGunPickupAllowed( self, ply, ent )
end
@@ -260,8 +274,8 @@ function GM:CanTool( ply, tr, mode )
if ( table.HasValue( GMS.ProhibitedStools, mode ) && !ply:IsAdmin() ) then ply:SendMessage( "This tool is prohibited.", 3, Color( 200, 0, 0, 255 ) ) return false end
local ent = tr.Entity
- if ( !IsValid( ent ) && ent:GetClass() != "worldspawn" ) then return end
-
+ if ( !IsValid( ent ) && ent:GetClass() != "worldspawn" ) then return end
+
if ( !SPropProtection.PhysGravGunPickup( ply, ent ) ) then return false end
if ( ent:IsRockModel() || ent:IsNPC() || ent:IsTreeModel() || ent:IsPlayer() || ent:IsFoodModel() || ent:IsPickupProhibitedModel() || ent:GetClass() == "gms_buildsite" ) then return false end
diff --git a/gamemode/utility.lua b/gamemode/utility.lua
index 19d3807..7810ac2 100644
--- a/gamemode/utility.lua
+++ b/gamemode/utility.lua
@@ -3,12 +3,20 @@
function findRecursive(folderstring,recursive,dofunction)
local folderpath = "gamemodes/" .. GM.GAMEMODE_FOLDER_NAME .. "/gamemode/" .. folderstring .. "/"
local files, directories = file.Find(folderpath .. "*", "MOD")
+ /*
+ print("viewing " .. folderpath)
+ print("files:")
+ PrintTable(files)
+ print("directories:")
+ PrintTable(directories)
+ */
for k,v in pairs(files) do
+ --print("Found file:" .. folderstring .. "/" .. v)
dofunction(folderstring .. "/".. v)
end
if(recursive) then
for k,v in pairs(directories) do
- findRecursive(folderstring..v,recursive,dofunction)
+ findRecursive(folderstring.. "/" .. v,recursive,dofunction)
end
end
end