File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
lua/entities/gmod_wire_expression2 Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,7 @@ function PlayerChips:checkCpuTime()
343343
344344 while total_time > e2_timequota do
345345 local max_chip , max_time = self :findMaxTimeChip ()
346+
346347 if max_chip then
347348 total_time = total_time - max_time
348349 max_chip :Error (" Expression 2 (" .. max_chip .name .. " ): Per-player time quota exceeded" , " per-player time quota exceeded" )
@@ -367,7 +368,7 @@ function PlayerChips:remove(remove_chip)
367368 end
368369end
369370
370- E2Lib .PlayerChips = setmetatable ({}, {__index = function (self , ply ) local chips = PlayerChips :new () self [ply ] = chips return chips end })
371+ E2Lib .PlayerChips = E2Lib . PlayerChips or setmetatable ({}, {__index = function (self , ply ) local chips = PlayerChips :new () self [ply ] = chips return chips end })
371372
372373hook .Add (" Think" , " E2_Think" , function ()
373374 if e2_timequota > 0 then
@@ -391,13 +392,14 @@ function ENT:OnRemove()
391392 end
392393
393394 local owner = self .player
394- if not IsValid (owner ) then return end
395395
396- local chips = E2Lib .PlayerChips [owner ]
397- chips :remove (self )
396+ if IsValid (owner ) then
397+ local chips = E2Lib .PlayerChips [owner ]
398+ chips :remove (self )
398399
399- if # chips == 0 then
400- E2Lib .PlayerChips [owner ] = nil
400+ if # chips == 0 then
401+ E2Lib .PlayerChips [owner ] = nil
402+ end
401403 end
402404
403405 BaseClass .OnRemove (self )
You can’t perform that action at this time.
0 commit comments