We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d944a5 commit a8f4e99Copy full SHA for a8f4e99
OpenTESArena/src/Entities/EntityChunkManager.cpp
@@ -745,10 +745,10 @@ EntityInstanceID EntityChunkManager::getEntityFromPhysicsBodyID(JPH::BodyID body
745
// @todo: probably want a smarter lookup than this
746
for (int i = 0; i < this->entities.getTotalCount(); i++)
747
{
748
- const EntityInstance &entityInst = this->entities.get(i);
749
- if (entityInst.physicsBodyID == bodyID)
+ const EntityInstance *entityInst = this->entities.tryGet(i);
+ if (entityInst != nullptr && entityInst->physicsBodyID == bodyID)
750
751
- return entityInst.instanceID;
+ return entityInst->instanceID;
752
}
753
754
0 commit comments