|
100 | 100 |
|
101 | 101 | -- To cleanup and get the in-/outputs information. |
102 | 102 | local function copyAndSanitizeToPortRegister(register, registerTmp) |
103 | | - register = register or newPortRegister() |
| 103 | + if not register or not register.empty then |
| 104 | + register = newPortRegister() |
| 105 | + end |
| 106 | + |
104 | 107 | register:empty() |
105 | 108 |
|
106 | 109 | if not registerTmp then |
@@ -130,7 +133,9 @@ function ENT:UpdatePorts() |
130 | 133 | local wireEnts = self:GetWiredEntities() |
131 | 134 |
|
132 | 135 | for key, wireEnt in ipairs(wireEnts) do |
133 | | - wireEnt:_WMI_AddPorts(self.WireInputRegister, self.WireOutputRegister) |
| 136 | + if wireEnt._WMI_AddPorts then |
| 137 | + wireEnt:_WMI_AddPorts(self.WireInputRegister, self.WireOutputRegister) |
| 138 | + end |
134 | 139 | end |
135 | 140 | end |
136 | 141 |
|
@@ -174,7 +179,7 @@ function ENT:PrepairOutputGlobals(inputData, wireValue, wireEnt, wireDevice, own |
174 | 179 | return |
175 | 180 | end |
176 | 181 |
|
177 | | - -- This can be usefull if a lua_run entity is triggered |
| 182 | + -- This can be useful if a lua_run entity is triggered |
178 | 183 | -- Because entity.Fire and entity.AcceptInput are not run synchronously in the same frame, we use them in a custom entity.AcceptInput detour. |
179 | 184 | -- So we store them for later use in a custom entity.AcceptInput detour. |
180 | 185 |
|
@@ -202,7 +207,7 @@ function ENT:PrepairOutputGlobals(inputData, wireValue, wireEnt, wireDevice, own |
202 | 207 | end |
203 | 208 |
|
204 | 209 | function ENT:SetupOutputGlobals(globals) |
205 | | - -- This can be usefull if a lua_run entity is triggered |
| 210 | + -- This can be useful if a lua_run entity is triggered |
206 | 211 |
|
207 | 212 | local G = _G |
208 | 213 |
|
|
0 commit comments