From a00c1456162f1d146817af16735167f5122fab29 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Tue, 3 Jun 2014 18:47:08 +0200 Subject: [PATCH] Safety check for spawns --- src/Systems/TankSteeringSystem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Systems/TankSteeringSystem.cpp b/src/Systems/TankSteeringSystem.cpp index 8c475e6..e140f49 100644 --- a/src/Systems/TankSteeringSystem.cpp +++ b/src/Systems/TankSteeringSystem.cpp @@ -294,6 +294,12 @@ bool Systems::TankSteeringSystem::OnSpawnVehicle(const Events::SpawnVehicle &eve return false; auto spawnPointComponents = m_World->GetComponentsOfType(); + if (!spawnPointComponents) + { + LOG_ERROR("Found no spawn points!"); + return false; + } + for (auto &spawnPointComponent : *spawnPointComponents) { auto spawnPoint = spawnPointComponent->Entity;