Safety check for spawns

This commit is contained in:
2014-06-03 18:47:08 +02:00
parent aeb29cde8b
commit a00c145616
+6
View File
@@ -294,6 +294,12 @@ bool Systems::TankSteeringSystem::OnSpawnVehicle(const Events::SpawnVehicle &eve
return false;
auto spawnPointComponents = m_World->GetComponentsOfType<Components::SpawnPoint>();
if (!spawnPointComponents)
{
LOG_ERROR("Found no spawn points!");
return false;
}
for (auto &spawnPointComponent : *spawnPointComponents)
{
auto spawnPoint = spawnPointComponent->Entity;