Skip to content

Commit 8b98252

Browse files
authored
Fix eyepod unlink error (#3595)
Fixes: ``` - addons/wire/lua/entities/gmod_wire_eyepod.lua:169: attempt to call method 'UnlinkEnt' (a nil value) 1. <unknown> - addons/wire/lua/entities/gmod_wire_eyepod.lua:169 2. ProtectedCall - [C]:-1 3. <unknown> - lua/includes/extensions/entity.lua:158 4. <unknown> - addons/hook-library/lua/includes/modules/hook.lua:313 ```
1 parent 21e6f43 commit 8b98252

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lua/entities/gmod_wire_eyepod.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ function ENT:LinkEnt(vehicle)
166166
end
167167
self.pod = vehicle
168168
vehicle:CallOnRemove("wire_eyepod_remove",function()
169-
self:UnlinkEnt(vehicle)
169+
if self:IsValid() then
170+
self:UnlinkEnt(vehicle)
171+
end
170172
end)
171173

172174
self.rotate90 = false

0 commit comments

Comments
 (0)