TIC-80 icon indicating copy to clipboard operation
TIC-80 copied to clipboard

pmem doesn't save in MENU callback

Open borbware opened this issue 2 years ago • 0 comments

When trying to save something with the new custom game menu functionality inside the MENU callback, pmem(id,value) doesn't save the value.

-- menu: ITEM1
...
function item1()
	local value=pmem(0)
	trace(value) --this gives always zero
	value=4
	pmem(0,value)
	trace(pmem(0)) --somehow reading the value here gives the correct value of 4
end

function MENU(i)
	if i==0 then item1()end
end

borbware avatar Jun 14 '22 22:06 borbware