Skip to content

Commit ca17fdb

Browse files
committed
Fixed brawl causing a blue error screen on game load.
Fix a regression where multiple addresses assigned to the same name would always use the last assigned addresses value. (Caused low polling rates in Brawl) Bump version to 1.6.1
1 parent 76a21e5 commit ca17fdb

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

release.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[Setup]
1010
#define AppName "M'Overlay"
11-
#define AppVersion "1.6.0"
11+
#define AppVersion "1.6.1"
1212
AppName={#AppName}
1313
AppId={#AppName}
1414
AppVersion={#AppVersion}

source/modules/memory/init.lua

+10-5
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ local TYPES_READ = {
177177
["sbyte"] = memory.readByte,
178178
["byte"] = memory.readUByte,
179179
["short"] = memory.readShort,
180+
["int"] = memory.readInt,
180181

181182
["u8"] = memory.readUByte,
182183
["s8"] = memory.readByte,
@@ -225,12 +226,14 @@ function memory.newvalue(addr, offset, struct, name)
225226
assert(type(addr) == "number", "argument #1 'address' must be a number")
226227
assert(TYPES_READ[struct.type] ~= nil, "unhandled type: " .. struct.type)
227228

228-
name = name or struct.name or ""
229+
name = name or struct.name or addr
230+
231+
local init = struct.init or NULL
229232

230233
-- create/get a new value cache based off of the value name
231-
local tbl, key = memory.cacheValue(memory.values, name, struct.init or NULL)
234+
local tbl, key = memory.cacheValue(memory.values, name, init)
232235

233-
--log.debug("[MEMORY] VALUE CREATED %08X + %X %q", addr, offset, name)
236+
log.debug("[MEMORY] VALUE CREATED %08X + %X %q", addr, offset, name)
234237

235238
return setmetatable({
236239
name = name,
@@ -244,6 +247,7 @@ function memory.newvalue(addr, offset, struct, name)
244247
-- Setup the cache
245248
cache = tbl,
246249
cache_key = key,
250+
cache_value = init,
247251

248252
debug = struct.debug,
249253
}, ADDRESS)
@@ -257,8 +261,9 @@ function ADDRESS:update()
257261
local value, orig = self.read(self.address + self.offset)
258262

259263
-- Check if there has been a value change
260-
if self.cache[self.cache_key] ~= value then
261-
self.cache[self.cache_key] = value
264+
if self.cache_value ~= value then
265+
self.cache_value = value
266+
self.cache[self.cache_key] = self.cache_value
262267

263268
if self.debug then
264269
local numValue = tonumber(orig) or tonumber(value) or (value and 1 or 0)

0 commit comments

Comments
 (0)