UPD: Destroy Preview Entity when its not needed
This commit is contained in:
parent
9602197cb8
commit
ae618b628b
@ -123,6 +123,7 @@ void GameLayer::onUpdate()
|
||||
|
||||
if (Application::getInstance().keyboard->keyPressEvent(GLFW_KEY_ESCAPE)) {
|
||||
gameMode->resetActiveBuilding();
|
||||
BuildPreviewSystem::disableBuildPreview(*entityManager);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -90,6 +90,6 @@ void BuildPreviewSystem::updateBuildPreview(EntityManager &em, GameMode &gameMod
|
||||
|
||||
void BuildPreviewSystem::disableBuildPreview(EntityManager &em) {
|
||||
if (previewEntity != 0) {
|
||||
//em.destroyEntity(previewEntity);
|
||||
em.destroyEntity(previewEntity);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user