Añadida Tu peor pesadilla a la pantalla de Game Over
This commit is contained in:
@@ -16,6 +16,7 @@ Stats::Stats(std::string file, options_t *options)
|
||||
// Destructor
|
||||
Stats::~Stats()
|
||||
{
|
||||
checkWorstNightmare();
|
||||
#ifndef DEBUG
|
||||
saveToFile();
|
||||
#endif
|
||||
@@ -135,7 +136,7 @@ bool Stats::loadFromFile()
|
||||
}
|
||||
|
||||
// Carga las estadisticas desde un servidor
|
||||
bool Stats::loadFromServer()
|
||||
void Stats::loadFromServer()
|
||||
{
|
||||
if (options->online.enabled)
|
||||
{
|
||||
@@ -180,4 +181,18 @@ void Stats::saveToServer()
|
||||
jscore::setUserData(options->online.gameID, options->online.jailerID, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Calcula cual es la habitación con más muertes
|
||||
void Stats::checkWorstNightmare()
|
||||
{
|
||||
int deaths = 0;
|
||||
for (auto item : list)
|
||||
{
|
||||
if (item.died > deaths)
|
||||
{
|
||||
deaths = item.died;
|
||||
options->stats.worstNightmare = item.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user