Skip to content

Commit d148175

Browse files
authored
Merge pull request #3524 from llysdal/fpga-fixes
Bugfix for FPGA regarding infinite loop detection
2 parents 4605210 + a7e9690 commit d148175

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/entities/gmod_wire_fpga/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,7 @@ function ENT:Run(changedNodes)
682682
if self.Debug then print("\n================================================================================") end
683683

684684
--Extra
685-
if self.ExecutionCount != nil then
686-
self.ExecutionCount = self.ExecutionCount + 1
687-
end
685+
self.ExecutionCount = self.ExecutionCount + 1
688686
local bench = SysTime()
689687
self.CurrentExecution = bench
690688

@@ -797,12 +795,14 @@ function ENT:Run(changedNodes)
797795

798796
if gate.isInput then
799797
value = {self.InputValues[nodeId]}
798+
loopDetectionNodeId = nil
800799
elseif gate.isConstant then
801800
if gate.outputtypes[1] == "STRING" then
802801
value = { WireLib.ParseEscapes(node.value) }
803802
else
804803
value = {node.value}
805804
end
805+
loopDetectionNodeId = nil
806806
else
807807
if nodeId == loopDetectionNodeId and #nodeQueue == loopDetectionSize then
808808
--infinite loop...

0 commit comments

Comments
 (0)