1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

New command line option for testing: testingsavefrequency

Saving is slowest part of VCMI and for testing purposes like benchmarking it's helpful to create saves less often.
When --testingsavefrequency=N is specified client going to save only once in N days.

Option only active if other testing options are specified too.
This commit is contained in:
Arseniy Shestakov
2016-09-22 03:43:30 +03:00
parent dba58e5eb1
commit 9963b9e02b
2 changed files with 4 additions and 2 deletions

View File

@@ -178,7 +178,7 @@ void CPlayerInterface::yourTurn()
}
firstCall = 0;
}
else
else if(settings["testing"].isNull() || cb->getDate() % static_cast<int>(settings["testing"]["savefrequency"].Float()) == 0)
{
LOCPLINT->cb->save("Saves/" + prefix + "Autosave_" + boost::lexical_cast<std::string>(autosaveCount++ + 1));
autosaveCount %= 5;