From e2b7e5400da7cf8e95fbfc7da47b6f385a40b1ba Mon Sep 17 00:00:00 2001 From: William Moberg Date: Tue, 1 Mar 2016 10:20:52 +0100 Subject: [PATCH] Check so CapturePointGameMode pool exists and has a size. --- src/Game/Systems/PlayerSpawnSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 1ee674cb..e03a1778 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -19,7 +19,7 @@ void PlayerSpawnSystem::Update(double dt) // Should be able to support older maps with this. // TODO: In the future we might want to return instead, to avoid spawning in the menu for instance. auto pool = m_World->GetComponents("CapturePointGameMode"); - if (pool != nullptr) + if (pool != nullptr && pool->size() > 0) { // Take the first CapturePointGameMode component found. ComponentWrapper& modeComponent = *pool->begin();