This happens whether the library declares the variables or includes a common file to do so--it keeps track fine while in a single map, but when the map changes, the values are all zeroed. Map change is "normal" (not a IDCLEV cheat) and is within the same hub, even.
Picture this, basically:
Code: Select all
world int 42:fred[]; // in the #included file for maps and library
MAP01:
// supposed to store 37 to subscript 2 of fred[]
f_putval(2,37);
x = getval(2); // returns 37
MAP02:
// supposed to retrieve said value from fred[2]
x = f_getval(2); // returns zero
LIBUTIL:
function void f_putval(int ix, int amount)
{
fred[ix] = amount;
}
function int f_getval(int ix)
{
return fred[ix];
}