Finding the issue

This commit is contained in:
Zoe Roux
2021-06-17 18:34:08 +02:00
parent 353e6b254e
commit 26ac0e0a44
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -73,8 +73,8 @@ namespace BBM
auto &animation = entity.getComponent<AnimationsComponent>();
animation.setAnimIndex(5);
if (entity.hasComponent<ControllableComponent>())
entity.removeComponent<ControllableComponent>();
if (entity.hasComponent<AnimatorComponent>())
entity.removeComponent<AnimatorComponent>();
if (entity.hasComponent<TimerComponent>())
return;
entity.addComponent<TimerComponent>(1s, [](WAL::Entity &entity, WAL::Wal &wal) {
+3 -2
View File
@@ -48,9 +48,10 @@ namespace BBM
playersIconPath.push_back(path.replace(path.find("textures"), std::string("textures").size(), "icons"));
auto &newPlayer = scene->addEntity("add");
newPlayer.addComponent<LobbyComponent>(playerID++, newPlayer, newPlayer);
newPlayer.getComponent<LobbyComponent>().layout = entity.get().getComponent<ControllableComponent>().layout;
auto &lobby = newPlayer.getComponent<LobbyComponent>();
lobby.layout = entity.get().getComponent<ControllableComponent>().layout; // TODO layout was none.
std::string color = path.substr(path.find_last_of('/'), path.find_last_of('.'));
newPlayer.getComponent<LobbyComponent>().color = std::find(LobbySystem::colors.begin(), LobbySystem::colors.end(), color) - LobbySystem::colors.begin();
lobby.color = std::find(LobbySystem::colors.begin(), LobbySystem::colors.end(), color) - LobbySystem::colors.begin();
}
addMenuControl(*scene, sounds);