@@ -133,18 +133,16 @@ local function iterate_players()
133133 local stats = " HP Armr Kill Item Secr\n "
134134 for addr , player in pairs (dsda .player .items ) do
135135 playercount = playercount + 1
136- local health = rls (addr + PlayerOffsets .health , " Players" )
137- local armor = rls (addr + PlayerOffsets .armorpoints1 , " Players" )
138- local killcount = rls (addr + PlayerOffsets .killcount , " Players" )
139- local itemcount = rls (addr + PlayerOffsets .itemcount , " Players" )
140- local secretcount = rls (addr + PlayerOffsets .secretcount , " Players" )
136+ local killcount = player .killcount
137+ local itemcount = player .itemcount
138+ local secretcount = player .secretcount
141139
142140 total_killcount = total_killcount + killcount
143141 total_itemcount = total_itemcount + itemcount
144142 total_secretcount = total_secretcount + secretcount
145143
146144 stats = string.format (" %s P%i %4i %4i %4i %4i %4i\n " ,
147- stats , playercount , health , armor , killcount , itemcount , secretcount )
145+ stats , playercount , player . health , player . armorpoints1 , killcount , itemcount , secretcount )
148146 end
149147 if playercount > 1 then
150148 stats = string.format (" %s %-12s %4i %4i %4i\n " , stats , " All" , total_killcount , total_itemcount , total_secretcount )
@@ -154,23 +152,19 @@ end
154152
155153local function iterate ()
156154 if Init then return end
157-
158- for _ , addr in ipairs (Objects ) do
159- local x = rls (addr + MobjOffsets .x , " Things" )
160- local y = rls (addr + MobjOffsets .y , " Things" ) * - 1
161- local health = rls (addr + MobjOffsets .health , " Things" )
162- local radius = math.floor ((rls (addr + MobjOffsets .radius , " Things" ) >> 16 ) * Zoom )
163- local sprite = SpriteNumber [rls (addr + MobjOffsets .sprite , " Things" )]
164- local type = rl (addr + MobjOffsets .type , " Things" )
165- local pos = { x = mapify_x (x ), y = mapify_y (y ) }
155+
156+ for _ , mobj in ipairs (Objects ) do
157+ local pos = { x = mapify_x (mobj .x ), y = mapify_y (- mobj .y ) }
158+ local radius = math.floor ((mobj .radius >> 16 ) * Zoom )
159+ -- local sprite = SpriteNumber[mobj.sprite]
160+ local type = MobjType [mobj .type ]
166161 local color = " white"
167-
168- type = MobjType [type ]
169- if health <= 0 then color = " red" end
162+
163+ if mobj .health <= 0 then color = " red" end
170164 --[[ --
171- local z = rls(addr + Offsets.z) / 0xffff
172- local index = rl (addr + Offsets .index)
173- local tics = rl (addr + Offsets .tics)
165+ local z = mobj.z
166+ local index = mobj .index
167+ local tics = mobj .tics
174168 --]] --
175169 if in_range (pos .x , 0 , client .screenwidth ())
176170 and in_range (pos .y , 0 , client .screenheight ())
@@ -181,11 +175,11 @@ local function iterate()
181175 end
182176
183177 for addr , line in pairs (dsda .line .items ) do
184- local special = rws ( addr + LineOffsets .special , " Lines " )
185- local v1 = { x = rls ( addr + LineOffsets .v1_x , " Lines " ) ,
186- y = - rls ( addr + LineOffsets .v1_y , " Lines " ) }
187- local v2 = { x = rls ( addr + LineOffsets .v2_x , " Lines " ) ,
188- y = - rls ( addr + LineOffsets .v2_y , " Lines " ) }
178+ local special = line .special
179+ local v1 = { x = line .v1_x ,
180+ y = - line .v1_y , }
181+ local v2 = { x = line .v2_x ,
182+ y = - line .v2_y }
189183
190184 local color
191185 if special ~= 0 then color = 0xffcc00ff end
201195
202196local function init_objects ()
203197 for addr , mobj in pairs (dsda .mobj .items ) do
204- local x = rls ( addr + MobjOffsets . x , " Things " ) / 0xffff
205- local y = rls ( addr + MobjOffsets . y , " Things " ) / 0xffff * - 1
206- local type = rl ( addr + MobjOffsets .type , " Things " )
198+ local x = mobj . x / 0xffff
199+ local y = mobj . y / 0xffff * - 1
200+ local type = mobj .type
207201
208202 -- print(string.format("%d %f %f %02X", index, x, y, type))
209203 type = MobjType [type ]
@@ -215,7 +209,7 @@ local function init_objects()
215209 if y < OB .top then OB .top = y end
216210 if y > OB .bottom then OB .bottom = y end
217211 -- cache the Objects we need
218- table.insert (Objects , addr )
212+ table.insert (Objects , mobj )
219213 end
220214 end
221215end
0 commit comments