mirror of
https://github.com/metrostroi-repo/MetrostroiAddon.git
synced 2026-05-02 00:42:29 +00:00
Merge pull request #586 from metrostroi-repo/#581
Исправлена невозможность подключения удочки
This commit is contained in:
@@ -22,13 +22,15 @@ local function removeWeldBetweenEnts(ent1,ent2)
|
||||
end
|
||||
end
|
||||
function ENT:Use(ply)
|
||||
if self.Coupled then
|
||||
if IsValid(self.Coupled) then
|
||||
sound.Play("buttons/lever8.wav",self:GetPos())
|
||||
removeWeldBetweenEnts(self,self.Coupled)
|
||||
removeWeldBetweenEnts(self.Coupled,self)
|
||||
|
||||
self.Coupled.Connectors[self.ConnectorID] = nil
|
||||
self.Timer = CurTime()+2
|
||||
end
|
||||
self.ConnectorID = nil
|
||||
self.Coupled = nil
|
||||
if ( self:IsPlayerHolding() ) then return end
|
||||
if ply.PickupObject then ply:PickupObject( self ) end
|
||||
|
||||
@@ -392,16 +392,10 @@ function ENT:CheckContact(pos,dir,id,cpos)
|
||||
traceEnt:SetPos(self:LocalToWorld(cpos))
|
||||
traceEnt:SetAngles(self:GetAngles())
|
||||
traceEnt.Coupled = self
|
||||
traceEnt.ConnectorID = id
|
||||
sound.Play("udochka_connect.wav",traceEnt:GetPos())
|
||||
self.Connectors[id] = traceEnt
|
||||
DropEntityIfHeld(traceEnt)
|
||||
--[[timer.Simple(0,function()
|
||||
if not IsValid(traceEnt) or not traceEnt:IsPlayerHolding() then return end
|
||||
traceEnt:ForcePlayerDrop()
|
||||
if traceEnt.LastPickup and traceEnt.LastPickup:IsPlayer() then
|
||||
traceEnt.LastPickup:DropObject()
|
||||
end
|
||||
end)]]
|
||||
end
|
||||
end
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user