mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-03-01 03:30:04 +00:00
No need for string workaround anymore -- yay\!
This commit is contained in:
parent
1dbd41d79e
commit
322fc7b1ba
@ -236,19 +236,10 @@ def _setCheatCmds()#1
|
||||
return 0
|
||||
end
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Workaround for plasma string space filling up: allocate a real frame, so that child strings
|
||||
// will get freed up.
|
||||
def makeThing(funcTbl, n)
|
||||
word pFunc
|
||||
pFunc = *(funcTbl + n)
|
||||
return pFunc()
|
||||
end
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Abstract code for adding from a list of things (players, items, etc.)
|
||||
def selectThing(moduleNum, nThings, nSkip, prompt)#1
|
||||
word pModule, funcTbl, nFunc, p_thing, n_thing, n2
|
||||
word pModule, funcTbl, nFunc, pFunc, p_thing, n_thing, n2
|
||||
nFunc = -1
|
||||
|
||||
flipToPage1()
|
||||
@ -262,7 +253,8 @@ def selectThing(moduleNum, nThings, nSkip, prompt)#1
|
||||
|
||||
for n_thing = 1 to nThings
|
||||
nFunc = (n_thing-1+nSkip)<<1
|
||||
p_thing = makeThing(funcTbl, nFunc)
|
||||
pFunc = *(funcTbl + nFunc)
|
||||
p_thing = pFunc()
|
||||
printf2("%d: %s\n", n_thing, p_thing=>s_name)
|
||||
if (n_thing % 22) == 0 or n_thing == nThings
|
||||
mmgr(HEAP_COLLECT, 0)
|
||||
@ -270,7 +262,8 @@ def selectThing(moduleNum, nThings, nSkip, prompt)#1
|
||||
n2 = parseDecWithDefault(readStr(), 0)
|
||||
if n2 >= 1 and n2 <= nThings
|
||||
nFunc = (n2-1+nSkip) << 1
|
||||
p_thing = makeThing(funcTbl, nFunc)
|
||||
pFunc = *(funcTbl + nFunc)
|
||||
p_thing = pFunc()
|
||||
printf1("Adding '%s'\n", p_thing=>s_name)
|
||||
break
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user