File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,22 @@ return function(Vargs, GetEnv)
8888 log .Time = os.time ()
8989 end
9090
91+ if log .Player and type (log .Player ) ~= "table" then
92+ local id = log .Player .UserId
93+ local pData = Core .PlayerData [tostring (id )]
94+ local userInfo = pData .userInfo
95+
96+ if not userInfo then -- Cache table allocation for player userInfo table to save on memory
97+ userInfo = {
98+ Name = log .Player .Name ;
99+ UserId = id ;
100+ }
101+ pData .userInfo = userInfo
102+ end
103+
104+ log .Player = userInfo
105+ end
106+
91107 if tab then
92108 if tab .__meta == "DLL" then
93109 tab :AddToStartAndRemoveEndIfEnd (log , Logs .MaxLogs )
@@ -153,7 +169,7 @@ return function(Vargs, GetEnv)
153169 local newTab = if isTable then table.clone (log ) else log
154170
155171 if (isTable and not log .NoSave ) or not isTable then
156- if isTable and log .Player then
172+ if isTable and log .Player and type ( log . Player ) ~= "table" then
157173 local p = log .Player
158174 log .Player = {
159175 Name = p .Name ;
You can’t perform that action at this time.
0 commit comments