1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Fix reload

This commit is contained in:
Ilya Krasnow
2022-01-13 17:56:39 +03:00
committed by GitHub
parent cf37815bcb
commit a5044576ab

View File

@@ -398,8 +398,8 @@ end
function TOOL:Reload(trace) function TOOL:Reload(trace)
if CLIENT then return end if CLIENT then return end
if IsValid(trace.Entity) and trace.Entity._Settings then
local ply = self:GetOwner() local ply = self:GetOwner()
if IsValid(trace.Entity) and trace.Entity._Settings then
ply:ConCommand("gmod_tool train_spawner") ply:ConCommand("gmod_tool train_spawner")
ply:SelectWeapon("gmod_tool") ply:SelectWeapon("gmod_tool")
local tool = ply:GetTool("train_spawner") local tool = ply:GetTool("train_spawner")
@@ -411,10 +411,10 @@ function TOOL:Reload(trace)
net.Start("train_spawner_open") net.Start("train_spawner_open")
net.WriteTable(tool.Settings) net.WriteTable(tool.Settings)
net.Send(ply) net.Send(ply)
end
local spawner = ents.Create("gmod_train_spawner") local spawner = ents.Create("gmod_train_spawner")
spawner:SpawnFunction(ply) spawner:SpawnFunction(ply)
end
end end
function TOOL:LeftClick(trace) function TOOL:LeftClick(trace)
if not self.Train then return end if not self.Train then return end