* Get the address of user data at the given stack index */
| 281 | * Get the address of user data at the given stack index |
| 282 | */ |
| 283 | void* GetPointer(lua_State *L, int32 Index, bool *OutTwoLvlPtr) |
| 284 | { |
| 285 | bool bTwoLvlPtr = false; |
| 286 | void *Userdata = ::GetUserdataFast(L, Index, &bTwoLvlPtr); |
| 287 | if (Userdata) |
| 288 | { |
| 289 | if (OutTwoLvlPtr) |
| 290 | { |
| 291 | *OutTwoLvlPtr = bTwoLvlPtr; |
| 292 | } |
| 293 | return bTwoLvlPtr ? *((void**)Userdata) : Userdata; // return the address |
| 294 | } |
| 295 | return nullptr; |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * Push a UObject |