Skip to content

Commit

Permalink
Fix Lua error that occurs upon selling the door (#467)
Browse files Browse the repository at this point in the history
* Fix Lua error that occurs upon selling the door

* Fix

---------

Co-authored-by: Winkarst <74284083+Winkarst-cpu@users.noreply.github.co>
  • Loading branch information
Winkarst-cpu and Winkarst authored Jan 6, 2025
1 parent 25fca56 commit 9334896
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/doors/cl_plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ net.Receive("ixDoorMenu", function()

local door = net.ReadEntity()
local access = net.ReadTable()
local entity = net.ReadEntity()

if (IsValid(door)) then
if (IsValid(door) and !table.IsEmpty(access)) then
local entity = net.ReadEntity()

ix.gui.door = vgui.Create("ixDoorMenu")
ix.gui.door:SetDoor(door, access, entity)
end
Expand Down
2 changes: 2 additions & 0 deletions plugins/doors/sh_plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ do

if (#receivers > 0) then
net.Start("ixDoorMenu")
net.WriteEntity(self)
net.WriteTable({})
net.Send(receivers)
end

Expand Down

0 comments on commit 9334896

Please sign in to comment.