File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
lua/entities/gmod_wire_expression2 Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,11 @@ e2function number totalCpuUsage()
217217 local owner = self .player
218218 if not IsValid (owner ) then return self .timebench end
219219
220- return E2Lib .PlayerChips [owner ]:getTotalTime ()
220+ -- To avoid creating new table
221+ local chips = rawget (E2Lib .PlayerChips , owner )
222+ if not chips then return self .timebench end
223+
224+ return chips :getTotalTime ()
221225end
222226
223227[nodiscard ]
Original file line number Diff line number Diff line change @@ -392,9 +392,9 @@ function ENT:OnRemove()
392392 end
393393
394394 local owner = self .player
395+ local chips = rawget (E2Lib .PlayerChips , owner )
395396
396- if IsValid (owner ) then
397- local chips = E2Lib .PlayerChips [owner ]
397+ if chips then
398398 chips :remove (self )
399399
400400 if # chips == 0 then
You can’t perform that action at this time.
0 commit comments