Unless we check that a buffer resource actually exists, the engine will crash when unpacking. This can happen if a user destroys a resource but a LuaHBuffer still holds a reference to the resource
| 135 | // Unless we check that a buffer resource actually exists, the engine will crash |
| 136 | // when unpacking. This can happen if a user destroys a resource but a LuaHBuffer still holds a reference to the resource |
| 137 | static bool CanUnpackLuaBuffer(dmScript::LuaHBuffer* lua_buffer) |
| 138 | { |
| 139 | if (lua_buffer->m_Owner == dmScript::OWNER_RES) |
| 140 | { |
| 141 | uint64_t hash; |
| 142 | return dmResource::RESULT_OK == dmResource::GetPath(g_Factory, lua_buffer->m_BufferRes, &hash); |
| 143 | } |
| 144 | return true; |
| 145 | } |
| 146 | |
| 147 | static bool IsStream(lua_State *L, int index) |
| 148 | { |
no test coverage detected