Small bug fix

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

Former-commit-id: a76e2cd6c948b276822bd999dfa34bbe2316731f
Former-commit-id: 66521864c7fd1dd17ddbab56e3f5f28c38637951
This commit is contained in:
wdbee 2012-03-25 12:43:29 +00:00
parent 1cf9dba1e3
commit 1f1b5aca1c

View file

@ -44,13 +44,18 @@ void SimCarCollideZ(tCar *car)
if (dotProd < CRASH_THRESHOLD) {
car->collision |= SEM_COLLISION_Z_CRASH;
}
car->collision |= SEM_COLLISION_Z;
if ((car->carElt->_state & RM_CAR_STATE_FINISH) == 0) {
int deltaDamage = (int)(wheel->trkPos.seg->surface->kDammage * fabs(dotProd) * simDammageFactor[car->carElt->_skillLevel]);
if (deltaDamage > 1)
{
car->collision |= SEM_COLLISION_Z;
car->dammage += deltaDamage;
}
}
car->DynGCg.vel.x -= normal.x * dotProd;
car->DynGCg.vel.y -= normal.y * dotProd;
car->DynGCg.vel.z -= normal.z * dotProd;
if ((car->carElt->_state & RM_CAR_STATE_FINISH) == 0) {
car->dammage += (int)(wheel->trkPos.seg->surface->kDammage * fabs(dotProd) * simDammageFactor[car->carElt->_skillLevel]);
}
}
}
}