🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

gvar-index bug

Started by
0 comments, last by WitchLord 19 years, 7 months ago
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
Advertisement
Yeah, the modules that were implemented in version 1.8.0 unfortunately introduced a lot of bugs like this one. However, I believe most of those bugs have been eliminated already. Especially this one was removed a long time ago.

Thanks anyway.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement