E2 Functions do not add their op cost
Denneisk opened this issue · 0 comments
Denneisk commented
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.
wire/lua/entities/gmod_wire_expression2/base/compiler.lua
Lines 1989 to 1992 in aab46e3
As shown above,
Compiler.GetOperator
adds to the op count as expected. Compiler.GetFunction
lacks this feature.