mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
Merge pull request #1189 from CapsAdmin/phys-event-fix
Made physgun event use a table. Fixes: #1187
This commit is contained in:
commit
35ff332bea
@ -12,8 +12,15 @@ pac.AddHook("DrawPhysgunBeam", "physgun_event", function(ply, wep, enabled, targ
|
||||
ply.pac_drawphysgun_event = nil
|
||||
end
|
||||
|
||||
if ply.pac_drawphysgun_event_part and ply.pac_drawphysgun_event_part:IsValid() then
|
||||
ply.pac_drawphysgun_event_part:OnThink()
|
||||
local pac_drawphysgun_event_part = ply.pac_drawphysgun_event_part
|
||||
if pac_drawphysgun_event_part then
|
||||
for event in pairs(pac_drawphysgun_event_part) do
|
||||
if event:IsValid() then
|
||||
event:OnThink()
|
||||
else
|
||||
pac_drawphysgun_event_part[event] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -308,7 +308,12 @@ PART.OldEvents = {
|
||||
using_physgun = {
|
||||
callback = function(self, ent)
|
||||
ent = self:GetPlayerOwner()
|
||||
ent.pac_drawphysgun_event_part = self
|
||||
local pac_drawphysgun_event_part = ent.pac_drawphysgun_event_part
|
||||
if not pac_drawphysgun_event_part then
|
||||
pac_drawphysgun_event_part = {}
|
||||
ent.pac_drawphysgun_event_part = pac_drawphysgun_event_part
|
||||
end
|
||||
pac_drawphysgun_event_part[self] = true
|
||||
return ent.pac_drawphysgun_event ~= nil
|
||||
end,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user