- fix tyre track sides being swapped

This commit is contained in:
InspirationByte 2022-02-04 21:15:00 +03:00
parent 4086bbaf9c
commit 6b780a822b
2 changed files with 12 additions and 11 deletions

View File

@ -1490,10 +1490,6 @@ void CheckCarEffects(CAR_DATA* cp, int player_id)
char tracks_and_smoke;
char channel, desired_skid, desired_wheel;
wheels_on_ground = 0;
lay_down_tracks = 0;
tracks_and_smoke = 0;
if (cp->controlType != CONTROL_TYPE_PLAYER &&
cp->controlType != CONTROL_TYPE_LEAD_AI &&
cp->controlType != CONTROL_TYPE_CUTSCENE)
@ -1508,6 +1504,10 @@ void CheckCarEffects(CAR_DATA* cp, int player_id)
// [A] do hubcaps here
HandlePlayerHubcaps(player_id);
wheels_on_ground = 0;
lay_down_tracks = 0;
tracks_and_smoke = 0;
for (cnt = 0; cnt < 4; cnt++)
{
if (cp->hd.wheel[cnt].susCompression != 0)
@ -1678,10 +1678,10 @@ void CheckCarEffects(CAR_DATA* cp, int player_id)
{
#if MAX_TYRE_TRACK_WHEELS == 4
ADD_WHEEL_TYRE_TRACK(0, 0)
ADD_WHEEL_TYRE_TRACK(2, 2)
ADD_WHEEL_TYRE_TRACK(2, 2)
#else
ADD_WHEEL_TYRE_TRACK(0, 0)
ADD_WHEEL_TYRE_TRACK(2, 1)
ADD_WHEEL_TYRE_TRACK(2, 1)
#endif
}
else
@ -1699,7 +1699,7 @@ void CheckCarEffects(CAR_DATA* cp, int player_id)
if (lay_down_tracks & 2) // front
{
ADD_WHEEL_TYRE_TRACK(1, 1)
ADD_WHEEL_TYRE_TRACK(3, 3)
ADD_WHEEL_TYRE_TRACK(3, 3)
}
else
{

View File

@ -76,19 +76,20 @@ void GetTyreTrackPositions(CAR_DATA *cp, int player_id)
CarPos.vz = cp->hd.where.t[2];
car_cos = cp->ap.carCos;
SetRotMatrix(&cp->hd.drawCarMat);
SetRotMatrix(&cp->hd.where);
steps = 4 / MAX_TYRE_TRACK_WHEELS;
for (loop = 0; loop < 4; loop += steps)
{
WheelPos.vx = car_cos->wheelDisp[loop].vx;
if (loop & 2)
WheelPos.vx = car_cos->wheelDisp[loop].vx + 17;
WheelPos.vx += 17;
else
WheelPos.vx = car_cos->wheelDisp[loop].vx - 17;
WheelPos.vx -= 17;
WheelPos.vy = 0;
WheelPos.vz = -car_cos->wheelDisp[loop + 1 & 3].vz;
WheelPos.vz = car_cos->wheelDisp[loop + 1 & 3].vz;
_MatrixRotate(&WheelPos);