add engine information for karts

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8071 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: a2a0d88a7e52f0a1cd6dd67dff88eabb6e1e25f1
Former-commit-id: a632948d2cfd6d9fedb5e89888540e07463afcce
This commit is contained in:
iobyte 2022-03-06 03:11:16 +00:00
parent bee791d006
commit 229eaa6f24
2 changed files with 8 additions and 1 deletions

View file

@ -2188,6 +2188,8 @@ evalUnit (char *unit, tdble *dest, int invert)
coeff = 14.59484546f; /* kg */
} else if (strcmp(unit, "kN") == 0) {
coeff = 1000.0f; /* N */
} else if (strcmp(unit, "cc") == 0) {
coeff = 0.001f; /* l */
}
if (invert) {

View file

@ -313,7 +313,12 @@ void RmGarageMenu::resetCarDataSheet(const std::string& strSelCarId)
ossSpecValue << "cyl. ";
}
if (pSelCar->getEngineCapacity() > 0)
ossSpecValue << std::setprecision(1) << pSelCar->getEngineCapacity() << " l ";
{
if (pSelCar->getEngineCapacity() >= 1)
ossSpecValue << std::setprecision(1) << pSelCar->getEngineCapacity() << " l ";
else
ossSpecValue << std::setprecision(1) << (pSelCar->getEngineCapacity() * 1000.0) << " cc ";
}
if (pSelCar->isTurboCharged())
ossSpecValue << "turbo";
if (ossSpecValue.str().empty())