Nodes bug fix & added alternate mining mode

master
E. Almqvist 5 years ago
parent f0f4154e1b
commit 8132e35e2e
  1. 1
      gamemode/engine/lib/sh_items.lua
  2. 17
      gamemode/engine/lib/sh_node.lua
  3. 2
      gamemode/settings/sv_settings.lua

@ -61,4 +61,5 @@ if SERVER then
function Quantum.Server.Item.SpawnItemAtPlayer( pl, itemid, amount ) -- Quantum.Server.Item.SpawnItemAtPlayer( Entity(1), "potatoe", 1 ) function Quantum.Server.Item.SpawnItemAtPlayer( pl, itemid, amount ) -- Quantum.Server.Item.SpawnItemAtPlayer( Entity(1), "potatoe", 1 )
Quantum.Server.Item.SpawnItem( pl:GetPos() + ( pl:GetForward() * 40 ) + Vector( 0, 0, 40 ), itemid, amount ) -- Quantum.Server.Item.SpawnItemAtPlayer( Entity(1), "jetpack", 1 ) Quantum.Server.Item.SpawnItem( pl:GetPos() + ( pl:GetForward() * 40 ) + Vector( 0, 0, 40 ), itemid, amount ) -- Quantum.Server.Item.SpawnItemAtPlayer( Entity(1), "jetpack", 1 )
end end
end end

@ -146,17 +146,22 @@ if SERVER then
if( canGather ) then if( canGather ) then
if( dmgInfo != nil ) then if( dmgInfo != nil ) then
self:SetHealth( self:Health() - dmgInfo:GetDamage() ) ent:SetHealth( ent:Health() - dmgInfo:GetDamage() )
if( self:Health() <= 0 ) then if( ent:Health() <= 0 ) then
Quantum.Node.Remove( self ) Quantum.Node.Remove( ent )
end end
end end
local loot, amount = randomizeLootTable( nodeTbl.give, nodeTbl.giveprobability ) local loot, amount = randomizeLootTable( nodeTbl.give, nodeTbl.giveprobability )
if( loot != nil ) then if( loot != nil ) then
Quantum.Server.Inventory.GiveItem( pl, loot, amount ) if( !Quantum.Server.Settings.ItemsGatheredSpawnInWorld ) then
local itemTbl = Quantum.Item.Get( loot ) Quantum.Server.Inventory.GiveItem( pl, loot, amount )
Quantum.Notify.ItemGathered( pl, itemTbl, amount ) local itemTbl = Quantum.Item.Get( loot )
Quantum.Notify.ItemGathered( pl, itemTbl, amount )
else
local basepos = ent:GetPos()
Quantum.Server.Item.SpawnItem( basepos, loot, amount )
end
else else
return return
end end

@ -19,6 +19,8 @@ Quantum.Server.Settings.ItemDespawnTimer = 300
Quantum.Server.Settings.ItemPickupSound = "physics/cardboard/cardboard_box_impact_hard2.wav" Quantum.Server.Settings.ItemPickupSound = "physics/cardboard/cardboard_box_impact_hard2.wav"
Quantum.Server.Settings.ItemsGatheredSpawnInWorld = true
Quantum.Server.Settings.InitSpawnLocation = { Quantum.Server.Settings.InitSpawnLocation = {
pos = Vector( 12418.626953125, 9959.9345703125, 320.03125 ), pos = Vector( 12418.626953125, 9959.9345703125, 320.03125 ),
ang = Angle( 0, -2.1179277896881, 0 ) ang = Angle( 0, -2.1179277896881, 0 )

Loading…
Cancel
Save