@@ -149,13 +149,14 @@ Tracked = {
149149
150150-- tables
151151
152- Players = {}
153- Config = {}
154- PRandomInfo = {}
155- DivLines = {}
156- MapBlocks = {}
157- Intercepts = {}
158- GUITexts = {}
152+ Players = {}
153+ Config = {}
154+ PRandomInfo = {}
155+ DivLines = {}
156+ MapBlocks = {}
157+ Intercepts = {}
158+ InterceptsOverruns = {}
159+ GUITexts = {}
159160-- map object positions bounds
160161OB = {
161162 top = math.maxinteger ,
@@ -226,6 +227,57 @@ function grid_show()
226227 ShowGrid = not ShowGrid
227228end
228229
230+ local function fetch_intercept_overruns (limit )
231+ local ret = {}
232+ local list = {
233+ [ 12 ] = { name = " line_opening.lowfloor" , value = Globals .line_opening .lowfloor },
234+ [ 16 ] = { name = " line_opening.bottom" , value = Globals .line_opening .bottom },
235+ [ 20 ] = { name = " line_opening.top" , value = Globals .line_opening .top },
236+ [ 24 ] = { name = " line_opening.range" , value = Globals .line_opening .range },
237+ [160 ] = { name = " bulletslope" , value = Globals .bulletslope },
238+ -- originally nested lists, we keep them as one flat list for simplicity
239+ -- augend is taken from the original, addend is to indicate lua's 1-based lists
240+ [176 ] = { name = " playerstarts[0].x" , value = Globals .playerstarts [0 + 1 ].x },
241+ [178 ] = { name = " playerstarts[0].y" , value = Globals .playerstarts [0 + 1 ].y },
242+ [180 ] = { name = " playerstarts[0].angle" , value = Globals .playerstarts [0 + 1 ].angle },
243+ [182 ] = { name = " playerstarts[0].type" , value = Globals .playerstarts [0 + 1 ].type },
244+ [184 ] = { name = " playerstarts[0].options" , value = Globals .playerstarts [0 + 1 ].options },
245+ [186 ] = { name = " playerstarts[1].x" , value = Globals .playerstarts [1 + 1 ].x },
246+ [188 ] = { name = " playerstarts[1].y" , value = Globals .playerstarts [1 + 1 ].y },
247+ [190 ] = { name = " playerstarts[1].angle" , value = Globals .playerstarts [1 + 1 ].angle },
248+ [192 ] = { name = " playerstarts[1].type" , value = Globals .playerstarts [1 + 1 ].type },
249+ [194 ] = { name = " playerstarts[1].options" , value = Globals .playerstarts [1 + 1 ].options },
250+ [196 ] = { name = " playerstarts[2].x" , value = Globals .playerstarts [2 + 1 ].x },
251+ [198 ] = { name = " playerstarts[2].y" , value = Globals .playerstarts [2 + 1 ].y },
252+ [200 ] = { name = " playerstarts[2].angle" , value = Globals .playerstarts [2 + 1 ].angle },
253+ [202 ] = { name = " playerstarts[2].type" , value = Globals .playerstarts [2 + 1 ].type },
254+ [204 ] = { name = " playerstarts[2].options" , value = Globals .playerstarts [2 + 1 ].options },
255+ [206 ] = { name = " playerstarts[3].x" , value = Globals .playerstarts [3 + 1 ].x },
256+ [208 ] = { name = " playerstarts[3].y" , value = Globals .playerstarts [3 + 1 ].y },
257+ [210 ] = { name = " playerstarts[3].angle" , value = Globals .playerstarts [3 + 1 ].angle },
258+ [212 ] = { name = " playerstarts[3].type" , value = Globals .playerstarts [3 + 1 ].type },
259+ [214 ] = { name = " playerstarts[3].options" , value = Globals .playerstarts [3 + 1 ].options },
260+ [220 ] = { name = " bmapwidth" , value = Globals .bmapwidth },
261+ [228 ] = { name = " bmaporgx" , value = Globals .bmaporgx },
262+ [232 ] = { name = " bmaporgy" , value = Globals .bmaporgy },
263+ [230 ] = { name = " bmapheight" , value = Globals .bmapheight }
264+ }
265+
266+ for i = 0 , 230 do
267+ local source = list [i ]
268+ if source and i <= limit then
269+ local item = {
270+ offset = string.format (" %d bytes" , i ),
271+ value = string.format (" 0x%X" , source .value & 0xffffffff ),
272+ variable = source .name
273+ }
274+ table.insert (ret , item )
275+ end
276+ end
277+
278+ return ret
279+ end
280+
229281local function hook_intercepts ()
230282 local name = " Intercepts"
231283
@@ -264,6 +316,14 @@ local function hook_intercepts()
264316 )
265317 block = - block -- custom way to indicate overflow
266318 InterceptsInfo = InterceptsState .OVERFLOW
319+
320+ if not InterceptsOverruns [math.abs (block )] then
321+ InterceptsOverruns [math.abs (block )] = {}
322+ end
323+ InterceptsOverruns [math.abs (block )] = fetch_intercept_overruns (
324+ (count - MAXIMUM_INTERCEPTS ) * 12
325+ )
326+
267327 client .pause ()
268328 else
269329 text = string.format (
@@ -284,7 +344,7 @@ local function hook_intercepts()
284344 local object = {
285345 frac = string.format (" 0x%08x" , intercept .frac ),
286346 isaline = string.format (" 0x%08x" , intercept .isaline ),
287- offset = string.format (" %d bytes" , ( i - 1 ) * 12 ),
347+ offset = string.format (" %d bytes" ,( i - 1 - MAXIMUM_INTERCEPTS ) * 12 ),
288348 pointer = intercept .d ,
289349 block = math.abs (block )
290350 }
@@ -973,11 +1033,12 @@ end
9731033
9741034function clear_cache ()
9751035 reset_view ()
976- Lines = nil
977- DivLines = {}
978- MapBlocks = {}
979- Intercepts = {}
980- Tracked = {
1036+ Lines = nil
1037+ DivLines = {}
1038+ MapBlocks = {}
1039+ Intercepts = {}
1040+ InterceptsOverruns = {}
1041+ Tracked = {
9811042 [TrackedType .THING ] = TrackedEntity .new (" thing" ),
9821043 [TrackedType .LINE ] = TrackedEntity .new (" line" ),
9831044 [TrackedType .SECTOR ] = TrackedEntity .new (" sector" )
0 commit comments