Skip to content

Commit

Permalink
Fix delta
Browse files Browse the repository at this point in the history
  • Loading branch information
Denneisk committed Nov 15, 2023
1 parent 4bdb050 commit 085b095
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/entities/gmod_wire_expression2/base/compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,10 @@ local CompileVisitors = {

local sub_op, sub_ty = self:GetOperator("sub", { var.type, var.type }, trace)
return function(state) ---@param state RuntimeContext
return sub_op(state, state.GlobalScope[var_name], state.GlobalScope["$" .. var_name])
local deltaName, current = "$" .. var_name, state.GlobalScope[var_name]
local ret = sub_op(state, current, state.GlobalScope[deltaName] or wire_expression_types2[var.type][2])
state.GlobalScope[deltaName] = current
return ret
end, sub_ty
elseif data[1] == Operator.Trg then -- ~
return function(state) ---@param state RuntimeContext
Expand Down

0 comments on commit 085b095

Please sign in to comment.