diff --git a/assets.h b/assets.h index 8da4834..e25b7cf 100644 --- a/assets.h +++ b/assets.h @@ -24,6 +24,8 @@ static const char *LCR_maps[] = "#=s0B0 #fd910" // concrete wall "#^s1A0 #fk110" // ramps before wall + "#-s0q0" + "#;p0w0L #f5130" // bugs "#=f0s0 #fd110" // small labyrinth diff --git a/racing.h b/racing.h index 9220a65..f5d773b 100644 --- a/racing.h +++ b/racing.h @@ -913,14 +913,20 @@ if (TPE_vec3Dot(carVel,carForw) < 0) frontWheelMiddle = TPE_vec3Minus(frontWheelMiddle, _LCR_racingEnvironmentFunction(frontWheelMiddle,LCR_PHYSICS_UNIT / 4)); - uint8_t frontCollision = frontWheelMiddle.x == 0 && frontWheelMiddle.y == 0 && + uint8_t frontCollision = + carForw.y < TPE_FRACTIONS_PER_UNIT / 4 && // only when car is horizontal + carForw.y > -1 * TPE_FRACTIONS_PER_UNIT / 4 && + frontWheelMiddle.x == 0 && frontWheelMiddle.y == 0 && frontWheelMiddle.z == 0; if (frontCollision) { // stop the car immediately LCR_LOG1("car front pierced"); - LCR_racing.carNotOKCount += (LCR_racing.carNotOKCount < 15 ? 32 : 0); // TODO: consts + + LCR_racing.carNotOKCount += + //(LCR_racing.carNotOKCount < 15 ? 32 : 0); // TODO: consts + (LCR_racing.carNotOKCount < 20 ? 15 : 0); // TODO: consts } if ((LCR_racing.carBody.flags & TPE_BODY_FLAG_UNRESOLVED) || frontCollision ||