Skip to content

Commit e4aae97

Browse files
committed
2 parents 5ba13c3 + 04ed2de commit e4aae97

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/game/Game/LifebuoySystem.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ void dd::Systems::LifebuoySystem::Update(double dt)
4949
auto transformComponent = m_World->GetComponent<Components::Transform>(it->Entity);
5050
auto lifebuoyComponent = m_World->GetComponent<Components::Lifebuoy>(it->Entity);
5151

52+
if (!m_World->ValidEntity(it->Entity)){
53+
m_Lifebuoys.erase(it++);
54+
}
55+
56+
5257
if (transformComponent->Position.y < m_DownEdge) {
5358
m_World->RemoveEntity(it->Entity);
5459
m_Lifebuoys.erase(it++);

0 commit comments

Comments
 (0)