I've come across a probably related issue.
I have a database NPC reading and changing a value in a multidimensional array every 2 seconds:
PHP Code:
function onTimeout() {
for (temp.i: this.guilds_pending) {
if (temp.i[2] > 0) temp.i[2] -= 2;
chat = this.guilds_pending[0][2];
}
setTimer(2);
}
(I also used the for (i=0; etc. method for this, results were no different)
Watching it on player, it appears to be working absolutely fine. But when I view the NPC's flags, the value is recorded at 431990. The original number was 432000. On my Graal client, it's gone all the way down to 430914 now.
When I click Send on the script editing window (without changing anything), the number continues counting down as it should, but the stored value is still 431990.
I disable the entire script, and add:
PHP Code:
function onCreated() {
message(this.guilds_pending[0][2]);
}
It says the correct number (below 430914), but the flags still show it as 431990.
After an npcserver restart, the number produced by the message() is 431990.
The value isn't being saved perminantly. -_-;
Edit: Fixed a typo.