fix crash in entity hit box renderer

This commit is contained in:
Bixilon 2021-06-10 18:43:05 +02:00
parent 5c236bb530
commit 2c4d5439a5
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -49,7 +49,9 @@ class EntityHitBoxRenderer(
if (aabb != mesh?.aabb) {
this.meshes.remove(entity)
mesh?.unload()
if (mesh?.needsUpdate == true) {
mesh.unload()
}
nextMesh = createMesh(entity, aabb, visible)
}
return nextMesh