Closed Denneisk closed 8 months ago
E2 functions do not apply their op cost to the running chip.
Given the following code, one would expect the output to be above 5000.
@strict soundDuration("") print(opcounter())
However, the output will be a resounding 1.
Operators apply ops as expected.
@strict 1 + 2 + 3 print(opcounter())
Outputs 3.
I believe this is an oversight. https://github.com/wiremod/wire/blob/aab46e3a9653f2ebf812ad208eacbcfb1261d1a7/lua/entities/gmod_wire_expression2/base/compiler.lua#L1989-L1992 As shown above, Compiler.GetOperator adds to the op count as expected. Compiler.GetFunction lacks this feature.
Compiler.GetOperator
Compiler.GetFunction
E2 functions do not apply their op cost to the running chip.
Given the following code, one would expect the output to be above 5000.
However, the output will be a resounding 1.
Operators apply ops as expected.
Outputs 3.
I believe this is an oversight. https://github.com/wiremod/wire/blob/aab46e3a9653f2ebf812ad208eacbcfb1261d1a7/lua/entities/gmod_wire_expression2/base/compiler.lua#L1989-L1992 As shown above,
Compiler.GetOperator
adds to the op count as expected.Compiler.GetFunction
lacks this feature.