glua / gm_voxelate

A module for voxel support in Garry's Mod
https://glua.io
Other
21 stars 3 forks source link

Update vox_lua_bridge.cpp #56

Open 11Lee1 opened 5 years ago

11Lee1 commented 5 years ago

here

SwadicalRag commented 5 years ago

just reading over the code, i think it'll work, but why use c++ eldritch pointer arithmetic instead of just casting it to a GarrysMod::Lua::UserData and modifying the struct fields?

11Lee1 commented 5 years ago

yeah definitely better to just use that, would help with readability.

https://pastebin.com/0AGB4U0H

SwadicalRag commented 5 years ago

what's going on in this line?

*(unsigned int*)udata->data = (unsigned int)udata->data + 8;

it seems like a no-op since udata->data is later overwritten before a read.

11Lee1 commented 5 years ago

no idea to be completely honest, it's just what I interpreted the disassembly as. if you'd like you could always just call the PushVector function that's on the LuaInterfaces's vmt like so https://pastebin.com/MVzBkVnh or update the class