| 1108 | } |
| 1109 | |
| 1110 | uintptr_t GetInstanceId(lua_State* L) |
| 1111 | { |
| 1112 | DM_LUA_STACK_CHECK(L, 0); |
| 1113 | GetInstance(L); |
| 1114 | int instance_type = lua_type(L, -1); |
| 1115 | // We assume that all users of SetInstance puts some form of user data/light user data, it is an assumption that works for now |
| 1116 | uintptr_t id = (instance_type == LUA_TLIGHTUSERDATA || instance_type == LUA_TUSERDATA) ? (uintptr_t)lua_touserdata(L, -1) : 0; |
| 1117 | lua_pop(L, 1); |
| 1118 | return id; |
| 1119 | } |
| 1120 | |
| 1121 | struct ScriptWorld |
| 1122 | { |