Fixed bug where colliders were not properly deserialised

This commit is contained in:
Diren D Bharwani 2022-12-11 20:33:30 +08:00
parent c1d7702914
commit bf8a410fa2
2 changed files with 2 additions and 3 deletions

View File

@ -59,12 +59,11 @@ namespace SHADE
case SHCollisionShape::Type::SPHERE: case SHCollisionShape::Type::SPHERE:
{ {
SHSphereCollisionShape* sphere = spheres.find(shape->id)->second; SHSphereCollisionShape* sphere = spheres.find(shape->id)->second;
spheres.erase(shape->id);
delete sphere; delete sphere;
sphere = nullptr; sphere = nullptr;
spheres.erase(shape->id);
break; break;
} }
case SHCollisionShape::Type::CAPSULE: case SHCollisionShape::Type::CAPSULE:

View File

@ -237,8 +237,8 @@ namespace YAML
switch (colliderType) switch (colliderType)
{ {
case SHCollisionShape::Type::BOX: break;
case SHCollisionShape::Type::SPHERE: collider->AddSphereCollisionShape(1.0f); break; case SHCollisionShape::Type::SPHERE: collider->AddSphereCollisionShape(1.0f); break;
case SHCollisionShape::Type::BOX: break;
case SHCollisionShape::Type::CAPSULE: break; case SHCollisionShape::Type::CAPSULE: break;
default:; default:;
} }