Original Post
Hi in as_builder as_builder::RegisterGlobalVar() { ........ it should be gvar->index = mod->AllocGlobalMem(.....) ; instead of: gvar->index = mod->moduleID | mod->AllocGlobalMem(.....) ; } because there is no global mem, but a mem per module, so why store the module id in the index? this causes a bug when requesting the variable pointer (with multiple modules, i.e modID == 0x0001, then the first mod->gvar index == 0x00010001) because its returned like this: *pointer = (void*) (mod->globalMemAddressOf() + mod->globals[id]->index); if its needed to have the module id in the index of the gvar (but why?), then in scriptengine::GetGlobalVarPtr it should be: *pointer = (void*) (mod->globalMemAddressOf() + (mod->globals[id]->index & 0xFFFF)); but in this case, (mod->globals[id]->index) & 0xFFFF) == id, so it can be: *pointer = (void*) (mod->globalMemAddressOf() + id); Remeber that this is for 1.8.2b1 Best Regards, Lioric