Fixing timer save

This commit is contained in:
Zoe Roux
2021-06-20 16:56:22 +02:00
parent 4736d1790c
commit e6bc61dd3e
+4 -1
View File
@@ -130,7 +130,10 @@ namespace BBM {
std::ofstream playerFile(player);
std::ofstream bonusFile(bonus);
auto &ret = scene->view<TagComponent<Timer>, TimerComponent>();
_block << "timer: " << ret.front().get<TimerComponent>().ringIn.count();
if (ret.size())
_block << "timer: " << ret.front().get<TimerComponent>().ringIn.count();
else
_block << "timer: " << std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::minutes(3)).count();
_player << "players:";
_bonus << "bonuses:";