diff options
Diffstat (limited to 'gamemode')
| -rw-r--r-- | gamemode/itemsystem/common_plantable.lua | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/gamemode/itemsystem/common_plantable.lua b/gamemode/itemsystem/common_plantable.lua index 2728b9a..9c86491 100644 --- a/gamemode/itemsystem/common_plantable.lua +++ b/gamemode/itemsystem/common_plantable.lua @@ -14,18 +14,9 @@ local function plant(player, resourcename) net.SendToServer() end if(SERVER) then - print("Planting " .. resourcename) local tbl = GMS.Resources[resourcename] - print("Plant table:") - PrintTable(tbl) - if(tbl.GrowTime == nil) then - print(tbl.Name .. " .GrowTime is nil, this might be a bug!") - return - end - if(tbl.OnGrow == nil) then - print(tbl.Name .. " .OnGrow is nil, this might be a bug!") - return - end + assert(tbl.GrowTime != nil,tbl.Name .. " .GrowTime is nil!") + assert(isfunction(tbl.OnGrow),tbl.Name .. " .OnGrow is not a table") local tr = player:GetEyeTrace() local pent = ents.Create("gms_generic_plantable") @@ -83,7 +74,7 @@ function GAMEMODE.MakeGenericPlantChild( ply, pos, mdl, parent ) return ent end -function GAMEMODE.MakeGenericPlant( ply, pos, mdl, isTree ) +function GAMEMODE.MakeGenericPlant( ply, pos, mdl, isWorld ) local ent = ents.Create( "prop_dynamic" ) ent:SetAngles( Angle( 0, math.random( 0, 360 ), 0 ) ) ent:SetSolid( SOLID_VPHYSICS ) @@ -96,7 +87,7 @@ function GAMEMODE.MakeGenericPlant( ply, pos, mdl, isTree ) ent:Fadein() ent:RiseFromGround( 1, 50 ) - if ( !isTree && IsValid( ply ) ) then + if ( !isWorld && IsValid( ply ) ) then ent:SetNWEntity( "plantowner", ply ) SPropProtection.PlayerMakePropOwner( ply, ent ) else |
